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

Add a conversion from Period to Duration #55

Closed
GoogleCodeExporter opened this issue Mar 15, 2015 · 1 comment
Closed

Add a conversion from Period to Duration #55

GoogleCodeExporter opened this issue Mar 15, 2015 · 1 comment

Comments

@GoogleCodeExporter
Copy link

Periods which only contain fixed-length fields should be convertible to 
Duration, in a way which assumes a day is only ever 24 hours:

    // This will only use time fields, which are okay
    Period period = Period.Between(time1, time2);
    Duration duration = period.ToDuration();

Original issue reported on code.google.com by jonathan.skeet on 18 Apr 2012 at 6:04

@GoogleCodeExporter
Copy link
Author

Fixed in revision a23d9bd19a89.

Note that this will throw InvalidOperationException if you try to call 
ToDuration on a period with months or years.

Original comment by jonathan.skeet on 19 Apr 2012 at 8:06

  • Changed state: Fixed

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

1 participant