summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools
diff options
context:
space:
mode:
authorMitch Curtis <mitch.curtis@nokia.com>2012-08-06 12:08:42 +0200
committerQt by Nokia <qt-info@nokia.com>2012-08-08 09:43:45 +0200
commitebbd8e66717e7bf400b395e240569e72409c9959 (patch)
treedaafb8dd1bbff26fd8cb283601684c2a43294e94 /src/corelib/tools
parent6820f1716e991ef5e3e83d3f09658197417e4db5 (diff)
Clarify how days are counted in QDateTime::daysTo documentation.
Mention that the days are counted as the amount of times midnight is reached between the start and end date. Task-number: QTBUG-26780 Change-Id: I22ff6c56b748ac968d6991e0be3e10905c0634bd Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Diffstat (limited to 'src/corelib/tools')
-rw-r--r--src/corelib/tools/qdatetime.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/corelib/tools/qdatetime.cpp b/src/corelib/tools/qdatetime.cpp
index 87ff03cdcd..769ab0acb6 100644
--- a/src/corelib/tools/qdatetime.cpp
+++ b/src/corelib/tools/qdatetime.cpp
@@ -2765,9 +2765,17 @@ QDateTime QDateTime::addMSecs(qint64 msecs) const
/*!
Returns the number of days from this datetime to the \a other
- datetime. If the \a other datetime is earlier than this datetime,
+ datetime. The number of days is counted as the number of times
+ midnight is reached between this datetime to the \a other
+ datetime. This means that a 10 minute difference from 23:55 to
+ 0:05 the next day counts as one day.
+
+ If the \a other datetime is earlier than this datetime,
the value returned is negative.
+ Example:
+ \snippet code/src_corelib_tools_qdatetime.cpp 15
+
\sa addDays(), secsTo(), msecsTo()
*/