Changes between Initial Version and Version 1 of Ticket #12617, comment 6
- Timestamp:
- Mar 7, 2017, 2:50:20 PM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #12617, comment 6
initial v1 1 We could //correct// such an offset of timezone with the same way of pytz :1 We could //correct// such an offset of timezone with the same way of pytz, https://github.com/stub42/pytz/blob/release_2016.10/src/pytz/tzfile.py#L116: 2 2 3 3 {{{#!diff … … 17 17 + # Avoid "ValueError: tzinfo.utcoffset() must return a whole 18 18 + # number of minutes" (#12617) 19 + offset = timedelta(seconds= seconds - mod + (0 if mod < 30 else 60))19 + offset = timedelta(seconds=int((seconds + 30) // 60) * 60) 20 20 + return offset 21 21