Details
-
Bug
-
Resolution: Fixed
-
P3: Somewhat important
-
5.14.0
-
None
-
-
dea91dbb5 (dev), b3a00a38a (dev), 1d725c009 (6.8)
Description
As stated on https://doc.qt.io/qt-5/qtimezone.html#NameType-enum - shortName should return the short form of the time zone name, usually an abbreviation, e.g. "CET".
I've tested this on both Mac & Win:
- on OSX it returns "GMT+offset"
- on Windows it returns the LongName as a timeZone, never its shortName abbreviation. e.g. "Central European Time"
e.g.
QDateTime currentDateTime = QDateTime::currentDateTime(); qDebug() << currentDateTime.timeZone().displayName(currentDateTime,QTimeZone::DefaultName) << currentDateTime.timeZone().displayName(currentDateTime,QTimeZone::LongName) << currentDateTime.timeZone().displayName(currentDateTime,QTimeZone::ShortName) << currentDateTime.timeZone().displayName(currentDateTime,QTimeZone::OffsetName);
on MacOs returns:
"Central European Summer Time" "Central European Summer Time" "GMT+2" "UTC+02:00"
& on Windows the same code returns:
"Central Europe Daylight Time" "Central Europe Daylight Time" "Central Europe Daylight Time" "UTC+02:00"
Attachments
Issue Links
- relates to
-
QTBUG-32759 QDateTime - Add Windows support for timeZoneAbbreviation()
- Closed
-
QTBUG-115158 Time zone names and abbreviations are not localised
- Closed
-
QTBUG-112909 Support all CLDR's various ways of naming time-zones
- Open
-
QTBUG-102187 QTimeZone on Windows (w/o ICU) does not recognize some time zones reported by C++20
- Closed
For Gerrit Dashboard: QTBUG-84297 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
544309,37 | Implement feature timezone_locale's CLDR half | dev | qt/qtbase | Status: MERGED | +2 | 0 |
586614,3 | Mention GMT-offset form of short-names for timezones | dev | qt/qtbase | Status: MERGED | +2 | 0 |
587368,2 | Mention GMT-offset form of short-names for timezones | 6.8 | qt/qtbase | Status: MERGED | +2 | 0 |