KEP #2: datetime RFC3339 and ISO 8601 and requirement of tz

Till Adam till.adam at kdab.com
Wed Mar 2 11:36:10 CET 2011


On Wednesday 02 March 2011 11:29:11 Bernhard Reiter wrote:
> Am Dienstag, 1. März 2011 18:44:34 schrieb Till Adam:
> > > Not all variants of RFC3339 make sense to have in the storage.
> > > 
> > > I'd rather force writing of one variant of RFC3339 (which I gave)
> > > and add a "to make implementation easier clients MAY use a system
> > > function call for reading the datetime field and accept all sensible
> > > values."
> > 
> > I'm still not conviced the extra constraint pays off, but I'm not
> > strongly opposed to adding a suggestion about the prefered
> > serialization.
> 
> The current KEP2 id=10864 allows for the following values for instance
> 1990-12-32T23:59:60.123456789+08:00
> and then you can add a timezone which
> needs to take precedence over the +08:00 meaning I am not sure
> that all available library functions can deal with correctly.
> 
> For example Package: libqtcore4, Version: 4:4.6.3-4 Debian GNU Squeeze
> fails to interpret rfc3339 correctly for me:
>     // rfc3999 says those two examples shall be equivalent
>     QDateTime time0 = QDateTime::fromString("1996-12-19T16:39:57-08:00",
> Qt::ISODate);
>     QDateTime time1 = QDateTime::fromString("1996-12-20T00:39:57Z",
> Qt::ISODate);
>     QCOMPARE(time0.toUTC(), time1);
> FAIL!  : TestRFC3339::rfc3339() Compared values are not the same
>    Actual (time0.toUTC()): 1996/12/18 23:00:00.000[UTC]
>    Expected (time1): 1996/12/20 00:39:57.000[UTC]
> (I attach the full test application. Haven't tested Qt 4.7.2 yet.)

till at localhost>./rfc3339.app/Contents/MacOS/rfc3339                                                                                                                     
/tmp/rfc3339
********* Start testing of TestRFC3339 *********
Config: Using QTest library 4.7.2, Qt 4.7.2
PASS   : TestRFC3339::initTestCase()
PASS   : TestRFC3339::rfc3339()
PASS   : TestRFC3339::cleanupTestCase()
Totals: 3 passed, 0 failed, 0 skipped
********* Finished testing of TestRFC3339 *********


-- 
Till Adam | till.adam at kdab.com | Managing Director Germany
KDAB (Deutschland) GmbH & Co KG, a KDAB Group company
Tel. Germany +49-30-521325470, Sweden (HQ) +46-563-540090
KDAB - Qt Experts - Platform-independent software solutions




More information about the format mailing list