Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Inconsistency between period_to_seconds and seconds_to_period #294

Closed
larmarange opened this issue Jan 1, 2015 · 2 comments
Closed

Inconsistency between period_to_seconds and seconds_to_period #294

larmarange opened this issue Jan 1, 2015 · 2 comments

Comments

@larmarange
Copy link
Contributor

period_to_seconds considers that a year is equal 365 days while seconds_to_period considers that a year is equal to 365.25 days.

Therefore:

> seconds_to_period(period_to_seconds(years(2)))
[1] "1y 0m 364d 18H 0M 0S"
@vspinu
Copy link
Member

vspinu commented Jan 2, 2015

I don't quite understand why to use years in seconds_to_period in the first place. The code is not using months. I think it should not use years either.

@vspinu
Copy link
Member

vspinu commented Jan 2, 2015

Ok. I am removing years from there. We will probably need to add an optional argument that users could also use an approximate conversion to years and months. I am not sure on a clean interface yet. Probably something like units = c("day", "hour", "minute", "second") which is a bit verbose, and/or units = "dhms".

@vspinu vspinu closed this as completed in a4bf450 Jan 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants