Details
-
Bug
-
Resolution: Duplicate
-
P2: Important
-
None
-
5.12.1
-
None
Description
When system locale short date is set to show the year with two digits only the QDate::fromString() conversion results in a wrong century (1900 instead of 2000).
// System local short date: dd-MMM-yy QDate d1= QDate::currentDate(); QString s1 = d1.toString(Qt::SystemLocaleShortDate); // "11-Mrz-19" QDate d2= QDate::fromString(s1, Qt::SystemLocaleShortDate); QString s2 = d2.toString("dd.MM.yyyy"); // "11.03.1919"
In 2019 the base century should be 2000 for two digit year dates.
Attachments
Issue Links
- is duplicated by
-
QTBUG-82886 Qt::DefaultLocaleShortDate / QLocale::ShortFormat date parsing doesn't deal with 4-digit years
- Open
-
QTBUG-89147 QDate::fromString() still asumes we're in the 20th century
- Closed
For Gerrit Dashboard: QTBUG-74323 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
326021,1 | WIP: Add centuryStart parameters to date-time parsing methods | dev | qt/qtbase | Status: NEW | -2 | 0 |