[Qt-interest] New Date and Time Features in Qt5?
David Ching
dc at dcsoft.com
Mon May 30 01:04:43 CEST 2011
-----Original Message-----
Date: Sat, 28 May 2011 20:45:15 +0200
From: Konrad Rosenbaum <konrad at silmor.de>
Subject: Re: [Qt-interest] New Date and Time Features in Qt5?
To: qt-interest at qt.nokia.com
Message-ID: <201105282045.16170 at zaphod.konrad.silmor.de>
Content-Type: text/plain; charset="iso-8859-1"
On Saturday 28 May 2011, David Ching wrote:
>> I would also request that Daylight Savings Time be able to be
>> specified (or not), when converting between UTC and local time (and
vice-versa).
>
>What would be the use case for this? AFAIK there is no organisation that
ignores DST.
>
>...
>
>If you are on a Unix or Linux system you can switch to a simpler timezone
by setting the TZ variable to >something like TZ=UTC-8, but then you lose
correct history of the local time zone in your calculations.
Ideally, I would like to query the system for two things: 1) My timezone
and 2) whether DST is active or not. So I would get, e.g. UTC-8, DST=true.
As it is, the only thing I can do is ask Qt is for current time as UTC and
as Local and subtract one from the other, then I get UTC-7, which combines
the effects of both timezone with the DST. I do not know that my native
timezone is UTC-8, and DST is in effect.
You give the answer on Linux - use the TZ env var, but that doesn't help me
in cross platform situations that Qt is supposed to address.
Thanks,
David
More information about the Qt-interest-old
mailing list