forked from facebookincubator/velox
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Timestamp::toTimezone for negative timestamps (facebookincubator#…
…6788) Summary: The value of `seconds_` in `Timepstamp` is the starting point of one second, so when converting a `time_point` from milliseconds to seconds, it should always be rounded down. However, `std::chrono::duration_cast` will always round to 0, so for negative numbers (times before 1970-01-01 00:00:00), the result will be wrong(will differ from the correct result 1 second). Correcting the rounding behavior also affects the unit test of `date_format`, which is also fixed in this PR. Fixes facebookincubator#6489 and facebookincubator#6787. Pull Request resolved: facebookincubator#6788 Reviewed By: zacw7 Differential Revision: D49755789 Pulled By: pedroerp fbshipit-source-id: 65cb6967c871f1235eded924804635379e11d88d
- Loading branch information
1 parent
2a5845b
commit d090149
Showing
2 changed files
with
8 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters