@@ -160,7 +160,7 @@ coarserperiod(::Type{Month}) = (Year, 12)
160160 CompoundPeriod
161161
162162A `CompoundPeriod` is useful for expressing time periods that are not a fixed multiple of
163- smaller periods. For example, \ " a year and a day\ " is not a fixed number of days, but can
163+ smaller periods. For example, "a year and a day" is not a fixed number of days, but can
164164be expressed using a `CompoundPeriod`. In fact, a `CompoundPeriod` is automatically
165165generated by addition of different period types, e.g. `Year(1) + Day(1)` produces a
166166`CompoundPeriod` result.
@@ -482,7 +482,7 @@ const zero_or_fixedperiod_seed = UInt === UInt64 ? 0x5b7fc751bba97516 : 0xeae0fd
482482const nonzero_otherperiod_seed = UInt === UInt64 ? 0xe1837356ff2d2ac9 : 0x170d1b00
483483otherperiod_seed (x:: OtherPeriod ) = iszero (value (x)) ? zero_or_fixedperiod_seed : nonzero_otherperiod_seed
484484# tons() will overflow for periods longer than ~300,000 years, implying a hash collision
485- # which is relatively harmless given how infrequent such periods should appear
485+ # which is relatively harmless given how infrequently such periods should appear
486486Base. hash (x:: FixedPeriod , h:: UInt ) = hash (tons (x), h + zero_or_fixedperiod_seed)
487487# Overflow can also happen here for really long periods (~8e17 years)
488488Base. hash (x:: Year , h:: UInt ) = hash (12 * value (x), h + otherperiod_seed (x))
@@ -511,11 +511,7 @@ toms(c::Millisecond) = value(c)
511511toms (c:: Second ) = 1000 * value (c)
512512toms (c:: Minute ) = 60000 * value (c)
513513toms (c:: Hour ) = 3600000 * value (c)
514- toms (c:: Day ) = 86400000 * value (c)
515- toms (c:: Week ) = 604800000 * value (c)
516- toms (c:: Month ) = 86400000.0 * 30.436875 * value (c)
517- toms (c:: Quarter ) = 86400000.0 * 91.310625 * value (c)
518- toms (c:: Year ) = 86400000.0 * 365.2425 * value (c)
514+ toms (c:: Period ) = 86400000 * days (c)
519515toms (c:: CompoundPeriod ) = isempty (c. periods) ? 0.0 : Float64 (sum (toms, c. periods))
520516tons (x) = toms (x) * 1000000
521517tons (x:: Microsecond ) = value (x) * 1000
0 commit comments