gaborcsardi / parsedate

R package to parse dates given in arbitrary formats
65 stars 7 forks source link

Feature suggestion: Add rounding of fractional hours or minutes #47

Open billdenney opened 3 months ago

billdenney commented 3 months ago

Related to #43

@gaborcsardi, I can imagine that not everyone would want fractional seconds unless they are coming in the seconds part of the time.

For example, if someone gives a fractional hour, I assume that they would want minutes and maybe seconds, but they probably don't want fractional seconds. And similarly, if someone gives a fractional minutes, they probably want seconds, but they probably don't want fractional seconds.

My first thought is to add a round_time argument to parse_iso_8601(). That argument would have six ways it could be provided: