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

Comments

Projects
None yet
2 participants
@larmarange
Contributor

larmarange commented Jan 1, 2015

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

This comment has been minimized.

Show comment
Hide comment
@vspinu

vspinu Jan 2, 2015

Member

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.

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

This comment has been minimized.

Show comment
Hide comment
@vspinu

vspinu Jan 2, 2015

Member

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".

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 in a4bf450 Jan 2, 2015

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment