diff options
author | Liang Qi <liang.qi@nokia.com> | 2010-07-05 13:35:51 (GMT) |
---|---|---|
committer | Liang Qi <liang.qi@nokia.com> | 2010-07-05 13:35:51 (GMT) |
commit | 752d46c90ee0fc5f06f01feedd8e0659178b15d4 (patch) | |
tree | df627cda0259bc80cc4aad0341a8ac0bf6148a0e /tests/auto | |
parent | 0352f68257f67fc4d252e16b7d2f63a22bc60d4f (diff) | |
download | Qt-752d46c90ee0fc5f06f01feedd8e0659178b15d4.zip Qt-752d46c90ee0fc5f06f01feedd8e0659178b15d4.tar.gz Qt-752d46c90ee0fc5f06f01feedd8e0659178b15d4.tar.bz2 |
Support time zone designator in QDateTime::fromString() based on ISO 8601-2004 standard.
Task-number: QTBUG-11623
Reviewed-by: Denis Dzyubenko
Reviewed-by: David Boddie
Diffstat (limited to 'tests/auto')
-rw-r--r-- | tests/auto/qdatetime/tst_qdatetime.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/tests/auto/qdatetime/tst_qdatetime.cpp b/tests/auto/qdatetime/tst_qdatetime.cpp index 86a4c80..d23133d 100644 --- a/tests/auto/qdatetime/tst_qdatetime.cpp +++ b/tests/auto/qdatetime/tst_qdatetime.cpp @@ -1286,6 +1286,12 @@ void tst_QDateTime::fromString() dt = QDateTime::fromString("2002-10-01", Qt::ISODate); QCOMPARE(dt, QDateTime(QDate(2002, 10, 1), QTime(0, 0, 0, 0))); + dt = QDateTime::fromString("1987-02-13T13:24:51+01:00", Qt::ISODate); + QCOMPARE(dt, QDateTime(QDate(1987, 2, 13), QTime(12, 24, 51), Qt::UTC)); + + dt = QDateTime::fromString("1987-02-13T13:24:51-01:00", Qt::ISODate); + QCOMPARE(dt, QDateTime(QDate(1987, 2, 13), QTime(14, 24, 51), Qt::UTC)); + dt = QDateTime::fromString("Thu Jan 1 00:12:34 1970 GMT"); QCOMPARE(dt.toUTC(), QDateTime(QDate(1970, 1, 1), QTime(0, 12, 34), Qt::UTC)); |