diff options
author | Mitch Curtis <mitch.curtis@nokia.com> | 2012-09-03 15:26:39 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-03 15:58:08 +0200 |
commit | 1b4ab3764b989958109913ba59b0bc9a95aed6f2 (patch) | |
tree | 8ef2916af425912ad3fabcc5f140a244bece00d0 /src/corelib/tools/qdatetime.cpp | |
parent | c9819493d3d5697929b3aa09accb6cea0be10396 (diff) |
Clarify QDateTime documentation re timeSpec conversion.
Clarify the documentation for setTimeSpec, toTimeSpec, toUTC and
toLocalTime, to be clear on which ones return the same point in time,
and which one simply changes the timezone.
Change-Id: Ic47dd8876ea733f1df0f64eca5bdf00d04f8d0d4
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools/qdatetime.cpp')
-rw-r--r-- | src/corelib/tools/qdatetime.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp index 905055c0fe..8accc32930 100644 --- a/src/corelib/tools/qdatetime.cpp +++ b/src/corelib/tools/qdatetime.cpp @@ -2322,6 +2322,10 @@ void QDateTime::setTime(const QTime &time) /*! Sets the time specification used in this datetime to \a spec. + The datetime will refer to a different point in time. + + Example: + \snippet code/src_corelib_tools_qdatetime.cpp 19 \sa timeSpec(), setDate(), setTime(), Qt::TimeSpec */ @@ -2856,9 +2860,12 @@ qint64 QDateTime::msecsTo(const QDateTime &other) const /*! \fn QDateTime QDateTime::toTimeSpec(Qt::TimeSpec specification) const - Returns a copy of this datetime configured to use the given time + Returns a copy of this datetime converted to the given time \a specification. + Example: + \snippet code/src_corelib_tools_qdatetime.cpp 16 + \sa timeSpec(), toUTC(), toLocalTime() */ @@ -3570,6 +3577,10 @@ QDateTime QDateTime::fromString(const QString &string, const QString &format) Returns a datetime containing the date and time information in this datetime, but specified using the Qt::LocalTime definition. + Example: + + \snippet code/src_corelib_tools_qdatetime.cpp 17 + \sa toTimeSpec() */ @@ -3579,6 +3590,10 @@ QDateTime QDateTime::fromString(const QString &string, const QString &format) Returns a datetime containing the date and time information in this datetime, but specified using the Qt::UTC definition. + Example: + + \snippet code/src_corelib_tools_qdatetime.cpp 18 + \sa toTimeSpec() */ |