summaryrefslogtreecommitdiffstats
path: root/src/corelib/tools/qdatetime.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-201-1/+1
|\ | | | | | | Change-Id: If7e51514ed6832750e3ad967e4d322ccf920d2bb
| * Make QStringRef::right() consistent with QString::right()Eskil Abrahamsen Blomfeldt2014-10-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The implementation was inconsistent with QString::right(), and did not return the N rightmost characters but actually did the same as QString::mid(N) (returning the rightmost size - N characters.) Since this function is fairly recent (Qt 5.2), is documented to behave the same as QString::right(), and since these APIs are meant to be interchangeable, this needs to be fixed, even though it changes behavior. [ChangeLog][Important Behavior Changes] Changed QStringRef::right() to be consistent with QString::right(). The function now returns the N right-most characters, like the documentation already claimed. Change-Id: I2d1cd6d958dfa9354aa09f16bd27b1ed209c2d11 Task-number: QTBUG-41858 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devFrederik Gladhorn2014-10-091-2/+2
|\| | | | | | | Change-Id: I05fcd8dc66d9ad0dc76bb7f5bae05c9876bfba14
| * Don't use QStringLiteral in comparisonsMarc Mutz2014-10-091-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I7af3bf3a67c55dae33ffaf9922d004fa168a3f9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add Objective-C specific type converters to QDateTimeJake Petroules2014-10-071-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds the Objective-C NSDate/CDateRef converters to QDateTime [ChangeLog][QtCore][Objective-C] Added NSDate/CDateRef converters for QDateTime Task-number: QTBUG-37116 Change-Id: I937ea927083a2767b5b17f10a48bf453c9ff8b01 Reviewed-by: Jake Petroules <jake.petroules@petroules.com> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@digia.com>
* | Merge remote-tracking branch 'origin/5.4' into devOswald Buddenhagen2014-09-291-25/+18
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/tools/qbytearray.cpp src/gui/image/qimage.cpp src/gui/image/qppmhandler.cpp src/gui/kernel/qguiapplication.cpp src/gui/painting/qpaintengine_raster.cpp Change-Id: I7c1a8e7ebdfd7f7ae767fdb932823498a7660765
| * Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | | | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
| * Doc: corrected autolink errors qtbase/corelib/toolsNico Vertriest2014-09-241-6/+7
| | | | | | | | | | | | | | | | | | Also corrected some minor language/spelling issues Task-number: QTBUG-40362 Change-Id: I00d76521fc9beb4e7a4a83ff6dc3334a055a7148 Reviewed-by: Topi Reiniö <topi.reinio@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | QDateTime: Micro-optimize by using QString::fromLatin1 instead of ↵Robin Burchell2014-09-151-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | QString::fromUtf8. This data is clearly not (and will never be) utf8 data, so using fromLatin1 avoids the (slightly more expensive) utf8 mangling. I didn't see any significant impact on benchmarks, but I also wasn't specifically collecting data when making this change. Change-Id: I45190d40b2caccf15b1f9a1ae5b7dcd08cbd541f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | QDate: Micro-optimize for fromStringIso benchmark.Robin Burchell2014-09-151-2/+2
| | | | | | | | | | | | | | | | By using QStringRef instead of QString, we avoid a data copy. This takes the QDateTime::fromStringIso benchmark from 0.79ms to 0.53ms for me. Change-Id: Ibb36067491ffc275ce3b667cb0e04941aa9457f0 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Optimize qdatetime string parsingJędrzej Nowacki2014-08-141-16/+16
|/ | | | | | | | Replacing usage QString::split by QString::splitRef saves a few allocations. Change-Id: I1cadca296279248b75af6f9f8394c54f13c37c55 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Reduce QtCoreLib size by not repeating "UTC" string too often.Jędrzej Nowacki2014-07-251-3/+3
| | | | | | | | It is a minor reduction, in release build it is ~200 bytes Change-Id: I4f7972c95769f2e0ca1ddc935ff7a0a6b4379e2a Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com>
* Speedup qDebug() << QDate(...)Jędrzej Nowacki2014-07-141-1/+1
| | | | | | | We really do not need to do string parsing there. Change-Id: Ie2277d9ff0d0445285b7108023941af111d9baca Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Call tzset() before localtime_r() as the docs say.Gunnar Sletta2014-05-161-0/+3
| | | | | | | | Without it, one might run the risk of QDateTime::currentDateTime() returning an invalid QDateTime the first time after changing timezone. Change-Id: I3efb04d41e7fe4685f6cc5fb41b68424eb4b9eb8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime: Fix sign handling in the timezone offset writerDaniel Seither2014-05-081-1/+1
| | | | | | | | | Previously, this produced wrong results, for example -3:30 became -3:-30. Change-Id: I10efdfb48e5542b917c86b29cf8a99bfc26f7fe0 Reviewed-by: John Layt <jlayt@kde.org> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime: Fix sign handling in the timezone offset parserDaniel Seither2014-05-081-6/+13
| | | | | | | | | | | | | Previously, parsing negative timezone offsets with minutes != 00 produced wrong results. Examples (in -> out) -00:15 -> +00:15 -01:15 -> -00:45 Change-Id: I6fa30810a08bdf2996365661720b2e362e8aeb93 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: John Layt <jlayt@kde.org>
* Correctly manipulate tm_gmtoff the way qt_timezone() needs.Raphael Kubo da Costa2014-02-071-1/+11
| | | | | | | | | | | | | Follow-up to 91d3298: qt_timezone() expects the number of seconds west of UTC, whereas tm_gmtoff returns the number of seconds east of UTC, and contrary to the timezone variable it is not oblivious to DST. We have to account for those two facts and make sure we return a value compatible with what timezone would have. Change-Id: Iacb9077f50d4c847ac09e5a7e952d0e4cd22da1b Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Frederik Gladhorn2014-01-211-11/+45
|\ | | | | | | refs/staging/dev
| * Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2014-01-201-11/+45
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/tools/qstring.cpp src/gui/image/image.pri src/gui/image/qimage.cpp src/plugins/platforms/cocoa/qcocoawindow.h src/plugins/platforms/cocoa/qcocoawindow.mm src/plugins/platforms/eglfs/qeglfshooks_stub.cpp tests/auto/corelib/io/qstandardpaths/tst_qstandardpaths.cpp Change-Id: I3b9ba029c8f2263b011f204fdf68c3231c6d4ce5
| | * QNX: Fix compilation of qdatetime.cppSergio Ahumada2014-01-181-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Adding std:: to pow() to make it compile for BlackBerry 10. Change-Id: I9ab3cc626eb2ba872c09df33cdb820b50d075428 Reviewed-by: Wolfgang Bremer <wbremer@blackberry.com> Reviewed-by: Fabian Bumberger <fbumberger@rim.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Optimize QDateTime string parsingJędrzej Nowacki2014-01-171-11/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The patch reduces amount of allocations during string parsing by using QStringRef. The operation is safe as neither QDate nor QTime uses QString as a storage type Change-Id: Ib9f40d86e8e420653ac4fe8ba883d554331ffc32 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QDate - Fix parsing Qt::ISODateJohn Layt2014-01-111-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix parsing of ISO Date from being totally lenient to being semi-strict by requiring the separator positions to be non-numeric. [ChangeLog][Important Behavior Changes] Parsing of Qt::ISODate by QDate::fromString() and QDateTime()::fromString() is not as lenient as before, the date component separators are now required to be non-numeric. This means a string like "2000901901" will no longer be recognized as a valid ISO Date, but "2000/01/01" will still be even though it doesn't strictly meet the ISO format of "2000-01-01". Task-number: QTBUG-34141 Change-Id: I0e481144136c60d4cac61364b9b2c1d2cd1e78fc Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * QDateTime - Fix isValid() if invalid QTimeZoneJohn Layt2014-01-111-0/+9
| | | | | | | | | | | | | | | | | | | | | Explicitly check that the QTimeZone is valid before trying to use it. Change-Id: Iec415a2cb07071502fe71ee5ac92a7657e818f99 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Fix compilation error on FreeBSDGabriel de Dietrich2014-01-211-0/+5
|/ / | | | | | | | | | | | | | | | | timezone is defined differently in FreeBSD compared to other (more or less) POSIX-compliant Unices. Task-number: QTBUG-36080 Change-Id: I4ad1a5ccd0b9ddbadb9fdd90edc26cf0c7252dfb Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-11-261-10/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the conflicts in msvc_nmake.cpp the ifdefs are extended since we need to support windows phone in the target branch while it is not there in the current stable branch (as of Qt 5.2). Conflicts: configure qmake/generators/win32/msvc_nmake.cpp src/3rdparty/angle/src/libEGL/Surface.cpp src/angle/src/common/common.pri src/corelib/global/qglobal.h src/corelib/io/qstandardpaths.cpp src/plugins/platforms/qnx/qqnxintegration.cpp src/plugins/platforms/qnx/qqnxscreeneventhandler.h src/plugins/platforms/xcb/qglxintegration.h src/widgets/kernel/win.pri tests/auto/corelib/thread/qreadwritelock/tst_qreadwritelock.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/gui/text/qtextdocument/tst_qtextdocument.cpp tools/configure/configureapp.cpp Change-Id: I00b579eefebaf61d26ab9b00046d2b5bd5958812
| * QDateTime - Optimize refreshDateTime()John Layt2013-10-311-4/+1
| | | | | | | | | | | | | | | | | | | | A small optimization to the private refreshDateTime() function, improves standard performance tests by 0.3 msecs per iteration for affected functions, e.g. isValid() and offsetFromUtc() improve from 5.4 to 5.1. Change-Id: Ie67812649ef244388b484af35848b09d92dee38a Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QDateTime - Optimize date() and time() methodsJohn Layt2013-10-311-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimize the performance of date() and time(), resulting in a one-third improvement, and subsequent improvements in all date/time based functions. Tested over 1000 iterations of the standard benchmarks, in msecs per iteration: Before After date()/time() 0.3 0.2 setDate()/setTime() 0.9 0.8 daysTo() 0.6 0.4 Note original performance before msecs storage was 0.06. Change-Id: Ie838e560ddf7129281531dc965af56ac19cce91d Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-10-241-28/+33
|\| | | | | | | Change-Id: Ie56539b2e0be611a363b5f15ae5412a78d6945a2
| * QDateTime - Fix RFC 2822 Date FormattingJohn Layt2013-10-171-25/+3
| | | | | | | | | | | | | | | | | | The RFC 2822 date format should always use en_US locale for month and day names instead of whatever the system locale is. Also remove some duplicate code. Change-Id: Ia2f7ee405b4e0e2f04980301783b9488628da73f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * QDateTime - Fix toTimeSpec() for invalid datetimesJohn Layt2013-10-161-3/+30
| | | | | | | | | | | | | | | | | | | | Check if the datetime is valid before converting it to a different time spec. If it is invalid then just change the spec to keep behavior consistent with 5.1. Task-number: QTBUG-34020 Change-Id: I6630ec1d50f810a2178ab3222bd32af018085f81 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/stable' into devFrederik Gladhorn2013-10-111-48/+48
|\| | | | | | | Change-Id: Ib8cfeee7d9ca15e8ad520e428b72c200827a8628
| * Doc: Adding mark-up to boolean default values.Jerome Pasion2013-10-081-48/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default values should have mark-up to denote that they are code. This commit changes: -"property is true" to "property is \c true". -"Returns true" to "Returns \c true". -"property is false" to "property is \c false". -"returns true" to "returns \c true". -"returns false" to "returns \c false". src/3rdparty and non-documentation instances were ignored. Task-number: QTBUG-33360 Change-Id: Ie87eaa57af947caa1230602b61c5c46292a4cf4e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.com> Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* | Merge "Merge remote-tracking branch 'origin/stable' into dev" into ↵Sergio Ahumada2013-10-091-10/+44
|\| | | | | | | refs/staging/dev
| * QDateTime - Fix round-trip of second occurrence timesJohn Layt2013-09-271-10/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the Daylight Tme to Standard Time transition, the local time repeats itself, i.e. 2am occurs twice. Qt's behavior when setting this using the local time is ambiguous, as it depends on the system implementation of mktime, which behaves differently on different platforms. Currently this behavior remains undefined. When setting using an msecs or time_t value however we can determine the correct instance to use and cache it to ensure that any conversion back from local time to msecs is performed consistantly on all platforms. Note that caching this value will result in any calculations being wrong should the system time zone change, or its rules change. This will be fixed in Qt 5.3 when the system time zone change signal is implemented and QDateTime switches to using QTimeZone instead of mktime to provide consistnt behavior across platforms. The QTimeZone spec does not require this fix as it already caches the correct offset in setMSecsFromEpoch(). Change-Id: I799588db474e744a6d81e80f6a0442920569ebd3 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | WinRT: Locale handling supportKamil Trzcinski2013-10-051-0/+3
|/ | | | | | | | | | Provides locale-related codepaths for WinRT where existing Win32 API is unsupported. Change-Id: I35b83d6b208165b7660cac3c9b383cb6ba7e5cf9 Done-with: Maurice Kalinowski Reviewed-by: Andrew Knight <andrew.knight@digia.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
* Fix conversion from 8-bit to QString without proper encodingThiago Macieira2013-09-231-1/+1
| | | | | | | | Found by ICC. Change-Id: Icd89e7df828afdb2acf2c46e00698ef04d5d94c9 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: John Layt <jlayt@kde.org>
* QDateTime - Add QTimeZone supportJohn Layt2013-09-231-12/+297
| | | | | | | | | | | Add support to QDateTime for time zones using the new QTimeZone class. [ChangeLog][QtCore][QDateTime] Add support for a new Qt::TimeZone spec to be used with QTimeZone to define times in a specific time zone. Change-Id: I21bfa52a8ba8989b55bb74e025d1f2b2b623b2a7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Move some code aroundJohn Layt2013-09-201-231/+229
| | | | | | | | Move some of the static helper and private functions to better organize the code. No code actually changed. Change-Id: I6d5dd6bcb9fc5af56d2dbe9e53bc9f0a000c4fa4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Add api for isDaylightTime()John Layt2013-09-201-0/+26
| | | | | | | | | | Add new method to return if the current time is Daylight Time. [ChangeLog][QtCore][QDateTime] Added new method isDaylightTime() to return if the datetime is in Daylight Time or not. Change-Id: Icb93fd5dd0b2f7d83d2d4643eeb12922c1137e3e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Change serialise formatJohn Layt2013-09-201-28/+61
| | | | | | | | | | | | Change the datetime serialisation from using QDateTimePrivate::Spec to using Qt::TimeSpec. Only public classes and enums are now used to serialise, making the format safer.. Clean up the code to make each version clearer, this duplicates some code but is easier to read and support. Change-Id: I3d8fc05f50f8e8acb9edbb992e5ce06063654b8e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Fix Daylight Transition for "missing" hourJohn Layt2013-09-201-31/+143
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | When Daylight Time transtion goes from Standard Time to Daylight Time there is a "missing" hour, i.e. at 2am CET the clock goes forward to 3am. Currently QDateTime ignores this gap and considers the time to be valid and able to be manipulated. This change respects the transition, so any time set in the missing hour is considered invalid, and any date maths returns valid results. The validity in the current time zone needs to be checked every time isValid() is called in case the system time zone has changed since the last time it was checked. This is done by calling mktime to check the returned result matches the expected result. This could be very inefficient, but the returned offset value is cached each time so mktime is not required to be called again within each method call, effectively meaning mktime is called the same number of times by each method. Note that this means any new methods added must be careful to ensure either isValid() or refreshLocalTime() is called first by any method needing to use the UTC value. [ChangeLog][QtCore][QDateTime] The Standard Time to Daylight Time transition for Qt::LocalTime is now handled correctly. Any date set in the "missing" hour is now considered invalid. All date math results that fall into the missing hour will be automatically adjusted to a valid time in the following hour. Change-Id: Ia652c8511b45df15f4917acf12403ec01a7f08e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Change date/time storage to msecsJohn Layt2013-09-201-345/+527
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change from storing the date and time as QDate and QTime to a serialised msecs format. This format is a direct translation of the QDate and QTime values, it is not the actual msecs since the Unix epoch. This msecs format ensures we are always able to recreate the original QDate and QTime values, but should still simplify the code and improve performance. Because we no longer store the explicit date and time we need to store their isNull()/isValid() status separately. The changes in storage results in the same memory footprint as before. Note that this change does not optimize the code nor set out to fix the known bugs, it only seeks to maintain the current behavior, although some bugs are fixed implicitly. More bug fixes and optimizations will follow. [ChangeLog][Important Behavior Changes] The supported date range in QDateTime has been reduced to about +/- 292 million years, the range supported by the number of msecs since the Unix epoch of 1 Jan 1970 as stored in a qint64, and as able to be used in the setMSecsSinceEpoch() and toMSecsSinceEpoch() methods. Change-Id: I98804d8781909555d3313a3a7080eb8e70cb46ad Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Revert 15da0a5af20fe6771bcb94ef8d46edbd5c8fb64c.Mitch Curtis2013-09-191-15/+14
| | | | | | | | | | It apparently breaks users' applications. Task-number: QTBUG-33487 Change-Id: Iaeceb3a02b5c7b9ab839c14693aaffcdf9394bc6 Reviewed-by: John Layt <jlayt@kde.org> Reviewed-by: hjk <hjk121@nokiamail.com>
* QDateTime: fix unused function warning on non-WindowsMarc Mutz2013-09-161-1/+1
| | | | | Change-Id: I8fbf1f8b0ebfdf58cd72c724326227dc1610e746 Reviewed-by: John Layt <jlayt@kde.org>
* QDateTime - Store Qt::TimeSpec, remove Daylight StatusJohn Layt2013-09-141-98/+94
| | | | | | | | | | | | | | Change storing the spec from QDateTimePrivate::Spec to Qt::TimeSpec. Remove the storage and use of the Daylight Status as it is almost never set or used, and would be inaccurate if the tz were to change. It will be replaced later with proper daylight transition support. This simplifies the code and makes the msecs storage change easier. Change-Id: I78a70905025d7eddf1c2dc6001f6b490e5a2b3b8 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Switch to using msecs based functionsJohn Layt2013-09-141-183/+29
| | | | | | | | | | | | | | | | | | | | | | A number of QDateTime functions directly use or modify the data stored in the private, but future changes to store msecs and status make this maintenance more complicated. Where possible simplify this code to use the standard msecs functions, standard constructors, or public api instead. This greatly simplifies the functions and the following msecs storage code changes. This is an intermim step towards storing the time in msecs. Some functions will be slower as a result of this change, optimization will take place after all the msecs changes are completed. Note this also removes a test that used valid QDates outside the range of msecs, this change in behavior will be documented in the final mscs change. Change-Id: I6ef710f24babc7024091010064082e9be0b5bbfe Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QTime - Add public api for get/set msecs since start of dayJohn Layt2013-09-131-2/+21
| | | | | | | | | | | | | Add new public api to get and set the number of msecs since the start of the day. Modify QDateTime to use the new msecs api. [ChangeLog][QtCore][QTime] Added new methods fromMSecsSinceStartOfDay() to create a new QTime from an msecs value, and msecsSinceStartOfDay() to return the QTime as the number of msecs since the start of the day. Change-Id: I285b725b883f1f5524fda87ca81bd64ed99fe6f4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* QDateTime - Split QDateTimeParser into a separate fileJohn Layt2013-09-091-1715/+1
| | | | | | | | | | | | | Not strictly needed yet, but helps to reduce the size of QDateTime and make it easier to read a major re-write. Imposes separation of parser which will be needed if we make QLocale always use the system backends, after which only QDateTimeEdit widget will need the parser and it can be moved there. Change-Id: I6a5e9a3edf6fe8ff2340af6afecd8ba4bfde9dd4 Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Mitch Curtis <mitch.curtis@digia.com>
* QDateTime - Change debug output to ISO FormatJohn Layt2013-09-061-3/+18
| | | | | | | | | | | Change the debug format from Qt::TextDate to a more detailed ISO style format including better time spec output. [ChangeLog][QtCore][QDateTime] The debug datastream is now an ISO-like format instead of Qt::TextDate Change-Id: Iddbb8199c3bfbf7bca845482617e7a85da43259d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDateTime - Documentation clean-upsJohn Layt2013-09-061-27/+33
| | | | | | | | | Clarify the documentation with regard to what locale is used for names, fix missing hour, timezone and am/pm format code details. Change-Id: Ic2d507a89a005427bba0df6368364b47bcf58756 Reviewed-by: Mitch Curtis <mitch.curtis@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>