[mythtv] [mythtv-commits] Ticket #11538: XMLTV date parsing issue
Gary Buhrmaster
gary.buhrmaster at gmail.com
Thu May 16 00:39:18 UTC 2013
On Wed, May 15, 2013 at 11:36 PM, <noreply at mythtv.org> wrote:
> #11538: XMLTV date parsing issue
.....
> If the string has a non-zero offset (e.g. the same date in localtime -
> "20130513190000 +1000"), the QDateTime object now has a TimeSpec of
> Qt::OffsetFromUTC so the .toUTC() call works correctly. Personally, I
> think this is a QT defect... we've given it an offset, and it's ignored
> it. I've reproduced this behaviour with both Qt-4.8 and on my old box
> (Qt-3.3)
My first thoughts agree, a Qt defect. However, apparently this is the
"expected" behavior in the test harness, brokenness and all.
>From the tests (including the comments that this is probably wrong):
// Not sure about these two... it will currently be created as LocalTime, but it
// should probably be UTC according to the ISO 8601 spec (see 4.2.5.1).
QTest::newRow("ISO +0000") <<
QString::fromLatin1("1970-01-01T00:12:34+0000")
<< Qt::ISODate << QDateTime(QDate(1970, 1, 1), QTime(0, 12,
34), Qt::LocalTime);
QTest::newRow("ISO +00:00") <<
QString::fromLatin1("1970-01-01T00:12:34+00:00")
<< Qt::ISODate << QDateTime(QDate(1970, 1, 1), QTime(0, 12,
34), Qt::LocalTime);
So, another hack will be needed by stuartm.
Gary
More information about the mythtv-dev
mailing list