Add a conversion from Period to Duration #55

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

Comments

Projects
None yet
1 participant
@GoogleCodeExporter
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

This comment has been minimized.

Show comment
Hide comment
@GoogleCodeExporter

GoogleCodeExporter Mar 15, 2015

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