forked from tarantool/tarantool
-
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.
datetime: make timezones only affect formatting
This patch makes `datetime` handle specified `tz` or `tzoffset` properly. It means timezones are now only affect the way datetime objects are formatted instead of timestamp value they represent. The patch involves this changes in the behavior: 1. Creating/setting a `timestamp` value with `tz`/`tzoffset` results with a day time corresponding to the timestamp value plus the timezone offset. E.g if we create a datetime object with a timestamp corresponding to 9:12 o'clock in `+0000` timezone and set `tzoffset = -60` the resulting timestamp will represent 8:12 o'clock. 2. Setting a new `tz`/`tzoffset` affects the time of day represented by the datetime. E.g. if you update a datetime object of 11:12 o'clock having `tzoffset = 180` with `tzoffset = 120` the resulting datetime object will represent 10:12. Closes tarantool#10363 NO_DOC=will be in tarantool/doc#4720
- Loading branch information
1 parent
c50d2bb
commit 0b4b431
Showing
4 changed files
with
98 additions
and
13 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## bugfix/datetime | ||
|
||
* `datetime` methods now handle timezones properly. Now timezone changes | ||
only affect the way the object is formatted and don't alter the | ||
represented timestamp (gh-10363). |
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
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