[Qt-interest] New Date and Time Features in Qt5?

Jason H scorp1us at yahoo.com
Fri May 13 16:41:10 CEST 2011


Oh [diety] yes!

I've been complaining about the lack of timezone support for ages now. We live 
in a world with 24 time zones, and the majority of them don't use your time 
zone. I've been working on workflow apps where you manually have to convert it 
to UTC on the server, then convert back on the client. 


To make it work properly, we need locale aware dates, because that'll tell if 
the client is on a Christian calendar, or the Buddhist or Jewish calendars. 
Though in all my years, I've only encountered one sytem on a non-christian 
calendar - Buddhist which is some 500 years ahead. 


I don't care what we store it in - provided the client converts. I'd suggest a 
QUtcDate[Time] which would always be in UTC, and the rest in QLocaleDate[Time], 
with automatic conversion between one and the other. (Or QLocalDate[Time]) The 
local date time would be used for collection and display, the UTC would be used 
for storage. 


When I looked into this, I found there were some TZs with odd offsets of 30 and 
36 minutes, and other by-the-minute variations etc. 


It would be tempting to use one class and .[from|to]Utc() and .[from|to]Local() 
but it would be tricky to know if the UTC offset is being applied. We'd also 
have to worry about storage between time zone changes. (Acquire on one side, 
clock rolls forward or back, then store) With one class, we wouldn't know when 
we had already applied the DST. If we keep it separate, we know we will always 
account for it when it comes to storage time. 


Just some thoughts.



----- Original Message ----
From: John Layt <johnlayt at googlemail.com>
To: qt-interest at qt.nokia.com
Sent: Fri, May 13, 2011 10:00:29 AM
Subject: [Qt-interest] New Date and Time Features in Qt5?

Hi,

I work on KDE doing localization code including the date/time functions.  With 
OpenGov and Qt5 coming up we are looking to see if we can get some new 
features we want included in Qt's date and time handling.  

As part of that I would like to know what other Qt users are missing and would 
like to see supported.  The wider the community interest in adding new 
features the more likely they are to get them in.

The general sort of areas we are looking at include:
* More formatting options
* More date maths
* Proper timezone support
* Alternative calendar systems (Hebrew, Islamic, etc)

Just remember that Qt5 is trying to be mostly source compatible with Qt4 so 
radical overhauls will not be possible, but extending the existing api is an 
achievable goal.

Cheers!

John.

P.S. If your wanted feature already has a bug number please include it.
_______________________________________________
Qt-interest mailing list
Qt-interest at qt.nokia.com
http://lists.qt.nokia.com/mailman/listinfo/qt-interest




More information about the Qt-interest-old mailing list