9155a07667
The system locale backend on macOS uses system APIs to format dates and times in localized ways. Those system APIs appear to know more about time zones than the time_t functions (which artificially cut off before 1900) are willing to tell us. As a result, QDateTime is left to guess the offsets in use before 1900 but the locale-formatting takes a correct offset into account, which can lead to QDateTime and the locale-aware APIs using different offsets. This is further compounded by the system APIs taking into account the calendar transition from Julian to Gregorian. We can't do much about the latter. Previously we were formatting dates by passing the start of the day to the system APIs (which take a date-time, albeit using a "Date" name for the type), along with a date-format that ignores the time of day. For dates before 1900, if the system APIs know the offset in use was less than that in use in the early 1900s, QDateTime (using the latter) gets the start of the day slightly earlier than where the system APIs know it is, so the day before is the date at that time. Use noon on the day in question to avoid this problem, at least for zones that didn't do whole day offset-shifts (crossing the date line) before 1900. Document the problem and the limited extent to which we can solve it. Task-number: QTBUG-54955 Pick-to: 6.6 6.5 6.2 Change-Id: I5be1bfdb3013433ee248846533ef73af39f173f5 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> |
||
---|---|---|
.github/workflows | ||
bin | ||
cmake | ||
coin | ||
config.tests | ||
dist | ||
doc | ||
examples | ||
lib | ||
libexec | ||
LICENSES | ||
mkspecs | ||
qmake | ||
src | ||
tests | ||
util | ||
.cmake.conf | ||
.gitattributes | ||
.gitignore | ||
.lgtm.yml | ||
.tag | ||
CMakeLists.txt | ||
conanfile.py | ||
config_help.txt | ||
configure | ||
configure.bat | ||
configure.cmake | ||
dependencies.yaml | ||
qt_cmdline.cmake | ||
sync.profile |