Purge dangling uses of QDateTime deprecated time-spec changes

QDateTime::{to,set}TimeSpec and QTimeZone::setOffsetFromUtc()
shouldn't be referenced in docs aside from their own; they are
deprecated from 6.9.

Fixes: QTBUG-135238
Pick-to: 6.9.0 6.9 6.8
Change-Id: I835cfaa888dd3079f96719cd1c413dc7c2796fdb
Reviewed-by: Magdalena Stojek <magdalena.stojek@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@qt.io>
This commit is contained in:
Edward Welbourne 2025-03-27 12:01:04 +01:00
parent b1ed5f656f
commit 8c943392ae
2 changed files with 5 additions and 5 deletions

View File

@ -172,7 +172,7 @@ QDate lastMonday = 2020y / January / Monday[last];
//! [23] //! [23]
QDateTime local(QDateTime::currentDateTime()); QDateTime local(QDateTime::currentDateTime());
QDateTime UTC(local.toTimeSpec(QTimeZone::UTC)); QDateTime UTC(local.toTimeZone(QTimeZone::UTC));
qDebug() << "Local time is:" << local; qDebug() << "Local time is:" << local;
qDebug() << "UTC time is:" << UTC; qDebug() << "UTC time is:" << UTC;
qDebug() << "No difference between times represented:" << local.secsTo(UTC); qDebug() << "No difference between times represented:" << local.secsTo(UTC);

View File

@ -4147,7 +4147,7 @@ QTime QDateTime::time() const
details of that time zone). Equivalent to details of that time zone). Equivalent to
\c{timeRepresentation().timeSpec()}. \c{timeRepresentation().timeSpec()}.
\sa setTimeSpec(), timeRepresentation(), date(), time() \sa setTimeZone(), timeRepresentation(), date(), time()
*/ */
Qt::TimeSpec QDateTime::timeSpec() const Qt::TimeSpec QDateTime::timeSpec() const
@ -5330,7 +5330,7 @@ Qt::weak_ordering compareThreeWay(const QDateTime &lhs, const QDateTime &rhs)
Returns the system clock's current datetime, using the time representation Returns the system clock's current datetime, using the time representation
described by \a zone. If \a zone is omitted, local time is used. described by \a zone. If \a zone is omitted, local time is used.
\sa currentDateTimeUtc(), QDate::currentDate(), QTime::currentTime(), toTimeSpec() \sa currentDateTimeUtc(), QDate::currentDate(), QTime::currentTime(), toTimeZone()
*/ */
/*! /*!
@ -5349,7 +5349,7 @@ QDateTime QDateTime::currentDateTime()
Equivalent to \c{currentDateTime(QTimeZone::UTC)}. Equivalent to \c{currentDateTime(QTimeZone::UTC)}.
\sa currentDateTime(), QDate::currentDate(), QTime::currentTime(), toTimeSpec() \sa currentDateTime(), QDate::currentDate(), QTime::currentTime(), toTimeZone()
*/ */
QDateTime QDateTime::currentDateTimeUtc() QDateTime QDateTime::currentDateTimeUtc()
@ -5366,7 +5366,7 @@ QDateTime QDateTime::currentDateTimeUtc()
This number is like the POSIX time_t variable, but expressed in milliseconds This number is like the POSIX time_t variable, but expressed in milliseconds
instead of seconds. instead of seconds.
\sa currentDateTime(), currentDateTimeUtc(), toTimeSpec() \sa currentDateTime(), currentDateTimeUtc(), toTimeZone()
*/ */
/*! /*!