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

Adding small durations together and converting them to larger durations? #276

Closed
peterhurford opened this issue Nov 14, 2014 · 2 comments
Closed

Comments

@peterhurford
Copy link

@peterhurford peterhurford commented Nov 14, 2014

> minutes(10) + seconds(50) + seconds(11)
[1] "10M 61S"

Is there a way to get it to equal 11M 01S instead? Or a function to apply to 10M 61S to convert it to 11M 01S?

I've spent a fair bit of time looking through the documentation, other issues, and some source code, but I may still be missing something obvious.

@vspinu vspinu closed this in c9d832b Dec 13, 2014
@vspinu
Copy link
Member

@vspinu vspinu commented Dec 13, 2014

With the most recent dev version you can do:

> as.period(minutes(1000) + seconds(50) + seconds(11), unit = "hours")
[1] "16H 41M 1S"
> as.period(minutes(1000) + seconds(50) + seconds(11), unit = "minute")
[1] "1001M 1S"

Loading

@peterhurford
Copy link
Author

@peterhurford peterhurford commented Dec 13, 2014

Works for me. Thanks!

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants