Add functions to get milli/micro/nano-seconds from a DateTime#81
Add functions to get milli/micro/nano-seconds from a DateTime#81lifthrasiir merged 2 commits intochronotope:masterfrom
Conversation
Using the underlying naive::NaiveTime fractional part, we compute the number of milli/micro/nano-seconds since the last second boundary. The reason for not computing elapsed time since 1970 is because we would hit potential issues of i64s not being large enough (the range would be strictly smaller than the 64bit-timestamp range, causing compatibility issues).
|
I think it is a fine addition, but I have some questions:
|
Renamed accessors to subsec_{nano,micro,milli}, as suggested
in pull request comment. Also added warnings for leap second
consitions causing these values to exceed the normal range
of 0..10^n.
Fixed editor's previous obnoxious whitespace changes.
Renamed according to this schema.
Added prominent Rustdoc warnings to all accessors.
Fixed. Apologies for this: was trying out a new editor. |
|
@beneills I've squashed and merged the PR. Thank you! |
- Tons of documentation updates! (#77, #78, #80, #82 and my own changes as well) - `DateTime::timestamp_subsec_{millis,micros,nanos}` methods have been added. (#81) - When the system time records a leap second, the nanosecond component was mistakenly reset to zero. (#84) - `Local` offset misbehaves in Windows for August and later, due to the long-standing libtime bug (dates back to mid-2015). Workaround has been implemented. (#85)
Using the underlying naive::NaiveTime fractional part, we compute
the number of milli/micro/nano-seconds since the last second boundary.
The reason for not computing elapsed time since 1970 is because we
would hit potential issues of i64s not being large enough (the range
would be strictly smaller than the 64bit-timestamp range, causing
compatibility issues).
This was written in response to issue #74.