qt-interest@trolltech.com
[Top] [All Lists]

Re: QDateTime utc / localtime differs from gmtime / localtime

Subject: Re: QDateTime utc / localtime differs from gmtime / localtime
From: Frank Hemer
Date: Sat, 5 Apr 2008 12:58:05 +0200
On Saturday 05 April 2008 09:22:49 Thiago Macieira wrote:
> Frank Hemer wrote:
> >y: 47, m: 5, d: 21, h: 21, mm: 0, wt: 6
> >tdt: Sat Jun 21 21:00:00 1947, local: Sat Jun 21 22:00:00 1947
> >y: 47, m: 5, d: 22, h: 0, mm: 0, wt: 0
> >
> >I would have expected QDateTime::toUTC and QDateTime::toLocalTime to
> > return the same time diff as gmtime / localtime

I didn't mention before:
Timezone is Europe/Berlin

I'm developing a medical app, transmitting date of birth from a java server to 
a qt rich client.
Transmission format is a qint64 holding the milliseconds since Epoche (1970, 1, 
1).

> It would have, if you did not have a negative date. QDateTime timezone 
> rules depend on the Unix time_t, which starts in 1970.

That would mean, QDateTime cannot be used for DateTimes before Epoche??
This is not mentioned in the docs.

Well, so what chance do I have to convert the msecs to a valid date?
time_t, as implemented in QDateTime doesn't help as it is only valid after the 
Epoche.
Setting the value manually (QDateTime (QDate (y, m, d), QTime (h, m, s)), xxx) 
doesn't
help either?

Frank

--
To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with 
"unsubscribe" in the subject or the body.
List archive and information: http://lists.trolltech.com/qt-interest/

<Prev in Thread] Current Thread [Next in Thread>