Fix date_time_with_ms millisecond formatting - #570
Conversation
Signed-off-by: Mark Jin <mark@pixmoving.net>
fujitatomoya
left a comment
There was a problem hiding this comment.
good eye! thanks for the PR.
this is real bug. any timestamp whose subsecond portion is under 100 ms produced wrong output, which is a substantial fraction of timestamps in practice.
|
Pulls: #570 |
|
Tick the box to add this pull request to the merge queue (same as
|
|
@ahuazuipiaoliang can you rebase this? and then i will start the CI before merge. |
@fujitatomoya I've already rebased. |
|
Pulls: #570 |
|
failure tests are unrelated. |
Summary
Fix
{date_time_with_ms}formatting so the subsecond field is computed as milliseconds instead of taking the first three digits from an unpadded nanosecond string.Details
The previous implementation converted the nanosecond remainder to a decimal string without zero-padding and then used the first three characters. For values with leading zeros, such as
085860000 ns, this produced.858instead of.085.This PR computes milliseconds directly with
nanoseconds / 1000000and formats the value with%03.Testing
Added coverage for a timestamp whose nanosecond remainder has leading zeros.
Closes #569