diff --git a/src/corelib/doc/snippets/code/src_corelib_time_qdatetime.cpp b/src/corelib/doc/snippets/code/src_corelib_time_qdatetime.cpp index 05fbf042ec8..de41965b192 100644 --- a/src/corelib/doc/snippets/code/src_corelib_time_qdatetime.cpp +++ b/src/corelib/doc/snippets/code/src_corelib_time_qdatetime.cpp @@ -172,7 +172,7 @@ QDate lastMonday = 2020y / January / Monday[last]; //! [23] QDateTime local(QDateTime::currentDateTime()); -QDateTime UTC(local.toTimeSpec(QTimeZone::UTC)); +QDateTime UTC(local.toTimeZone(QTimeZone::UTC)); qDebug() << "Local time is:" << local; qDebug() << "UTC time is:" << UTC; qDebug() << "No difference between times represented:" << local.secsTo(UTC); diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index 6a11b101120..5c3c88e92ee 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -4147,7 +4147,7 @@ QTime QDateTime::time() const details of that time zone). Equivalent to \c{timeRepresentation().timeSpec()}. - \sa setTimeSpec(), timeRepresentation(), date(), time() + \sa setTimeZone(), timeRepresentation(), date(), time() */ 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 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)}. - \sa currentDateTime(), QDate::currentDate(), QTime::currentTime(), toTimeSpec() + \sa currentDateTime(), QDate::currentDate(), QTime::currentTime(), toTimeZone() */ QDateTime QDateTime::currentDateTimeUtc() @@ -5366,7 +5366,7 @@ QDateTime QDateTime::currentDateTimeUtc() This number is like the POSIX time_t variable, but expressed in milliseconds instead of seconds. - \sa currentDateTime(), currentDateTimeUtc(), toTimeSpec() + \sa currentDateTime(), currentDateTimeUtc(), toTimeZone() */ /*!