diff options
author | Edward Welbourne <edward.welbourne@qt.io> | 2021-02-11 16:07:47 +0100 |
---|---|---|
committer | Edward Welbourne <edward.welbourne@qt.io> | 2021-02-12 11:59:12 +0100 |
commit | 1fc3c6f9b9f62cc3ff2b9106a67523c76c63ac3b (patch) | |
tree | ce9b8aab68cdd0ef7ff6d6811c2c5c8dd77d6ca7 | |
parent | cc93dadf772480df3b27fd031a471047a5db0038 (diff) |
Update QDateTime::timeZoneAbbreviation docs
Include Qt::TimeZone as a possible spec, use a \list for the spec
values. Incidentally use the public QTimeZone::abbreviation() instead
of digging around in its privates to achieve the same effect.
Change-Id: Ibabbeac9b085b4d09de46bda911356c20faadae8
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
-rw-r--r-- | src/corelib/time/qdatetime.cpp | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index f85e4115bb..9ad9c9c597 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -1,6 +1,6 @@ /**************************************************************************** ** -** Copyright (C) 2020 The Qt Company Ltd. +** Copyright (C) 2021 The Qt Company Ltd. ** Copyright (C) 2016 Intel Corporation. ** Contact: https://www.qt.io/licensing/ ** @@ -3619,22 +3619,22 @@ int QDateTime::offsetFromUtc() const /*! \since 5.2 - Returns the Time Zone Abbreviation for the datetime. + Returns the Time Zone Abbreviation for this datetime. - If the timeSpec() is Qt::UTC this will be "UTC". + The returned string depends on timeSpec(): - If the timeSpec() is Qt::OffsetFromUTC this will be in the format - "UTC[+-]00:00". - - If the timeSpec() is Qt::LocalTime then the host system is queried for the - correct abbreviation. - - Note that abbreviations may or may not be localized. + \list + \li For Qt::UTC it is "UTC". + \li For Qt::OffsetFromUTC it will be in the format "UTC[+-]00:00". + \li For Qt::LocalTime, the host system is queried. + \li For Qt::TimeZone, the associated QTimeZone object is queried. + \endlist - Note too that the abbreviation is not guaranteed to be a unique value, - i.e. different time zones may have the same abbreviation. + \note The abbreviation is not guaranteed to be unique, i.e. different time + zones may have the same abbreviation. For Qt::LocalTime and Qt::TimeZone, + when returned by the host system, the abbreviation may be localized. - \sa timeSpec() + \sa timeSpec(), QTimeZone::abbreviation() */ QString QDateTime::timeZoneAbbreviation() const @@ -3652,7 +3652,7 @@ QString QDateTime::timeZoneAbbreviation() const break; #else Q_ASSERT(d->m_timeZone.isValid()); - return d->m_timeZone.d->abbreviation(toMSecsSinceEpoch()); + return d->m_timeZone.abbreviation(*this); #endif // timezone case Qt::LocalTime: { QString abbrev; |