summaryrefslogtreecommitdiffstats
path: root/src/plugins/tls/shared/qasn1element.cpp
diff options
context:
space:
mode:
authorEdward Welbourne <edward.welbourne@qt.io>2023-11-08 17:08:49 +0100
committerEdward Welbourne <edward.welbourne@qt.io>2023-12-08 11:40:36 +0100
commit41f84f3ddb780ec751e3fc706dd242fc4a99de7a (patch)
treec513e83065b9a62f11ed26270af58f336af81424 /src/plugins/tls/shared/qasn1element.cpp
parentb8fac538032cee6eb6f4e5dcbb5a31485bb59e46 (diff)
Give the caller control over the century used for two-digit dates
The twentieth century is now some way behind us, so using its years when parsing a date-time format that only provides the last two digits is increasingly likely to produce unwelcome results. Most such formats are saved by the "redundant" presence of a day-of-week field but, for those that are not (notably including ASN.1 date fields), there is a need to provide some way to over-ride the twentieth century default. Allow the caller to pass a base year to the fromString() methods, of QDate and QDateTime, and to QLocale's toDate() and toDateTime(), that indicates the first of 100 consecutive years, among which the two digits given can select a year. Add some test-cases to exercise the new API. [ChangeLog][QtCore][QDate] When fromString() has only a two-digit year to go on, it is now possible to set the start-year of the century within which this selects. [ChangeLog][QtCore][QDateTime] When fromString() has only a two-digit year to go on, it is now possible to set the start-year of the century within which this selects. [ChangeLog][QtCore][QLocale] When toDate() or toDateTime() has only a two-digit year to go on, it is now possible to set the start-year of the century within which this selects. Fixes: QTBUG-46843 Change-Id: Ieb312ee9e0b80557a15edcb0e6d75a57b10d7a62 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: MÃ¥rten Nordheim <marten.nordheim@qt.io>
Diffstat (limited to 'src/plugins/tls/shared/qasn1element.cpp')
0 files changed, 0 insertions, 0 deletions