Details
-
User Story
-
Resolution: Fixed
-
P2: Important
-
None
-
-
21
-
Qt6_Foundation_ Sprint 14, Qt6_Foundation_Sprint 15, Foundation Sprint 62, Foundation Sprint 63, Foundation Sprint 64, Foundation Sprint 65, Foundation Sprint 66, Foundation Sprint 67, Foundation Sprint 68, Foundation Sprint 69, Foundation Sprint 70, Foundation Sprint 71, Foundation Sprint 72, Foundation Sprint 73, Foundation Sprint 74, Foundation Sprint 75, Foundation Sprint 76, Foundation Sprint 77, Foundation Sprint 78, Foundations Sprint 79, Foundations Sprint 80, Foundation Sprint 81, Foundation Sprint 82, Foundation Sprint 83, Foundation Sprint 84, Foundation Sprint 85, Foundation Sprint 86, Foundation Sprint 87, Foundation Sprint 88, Foundation Sprint 89, Foundation Sprint 90, Foundation Sprint 91, Foundation Sprint 92, Foundation Sprint 93
-
a49ccc08c (dev)
Description
While QDateTime can map a UTC time to a local time, or time in some specified zone, in the overlap period of a zone transition, and will know which repeat of the time it represents (to the degree that it has the right offset from UTC, and will give the right time-zone if toString() is called with a suitable format) , we provide no way to indicate which repeat to use when constructing a time in this interval. The existing implementation will pick one of them; the user can check its isDaylightTime() and addSecs(60 * 60) (or minus that) to fix it up, but there should be a way to tell the constructor which repeat to use, when the specified time happens twice.
Python's datetime objects handle this using a "fold" parameter, set to 0 to get the first pass and 1 to get the second; this also affects handling of times in the gap when a time-zone transition skips an hour (as at the start of DST); PEP495 specifies the full semantics. In general, fold=0 selects the UTC offset in effect before the transition while fold=1 selects the offset in effect after the transition. I propose to add a parameter with the same semantics.
Attachments
Issue Links
- is blocked by
-
QTBUG-108199 Rework QTimeZone to make QTimeSystem redundant
- Closed
- is required for
-
QTBUG-79916 QDateTime format should support DST char
- Reported
- relates to
-
QTBUG-93847 correct QDateTime on March 28, 1976 reported as invalid
- Closed
-
QTBUG-68936 tst_QDateTime::daylightTransitions() makes invalid assumptions
- Closed
-
QTBUG-73225 QT DST beyond 2037
- Closed
-
QTBUG-80421 Use DST data even before 1970
- Closed