Making formatDateTime() and readDate() ... from KLocale timezone aware

Bruno Virlet bruno at virlet.org
Tue Aug 14 16:30:04 BST 2007


Hello,

I dropped a first mail without answer, I'll try to be more clear here.

In kdepim, in particular korganizer, we want a good support for timezones. The 
last step is to get good formatted KDateTime strings when a timezone is 
associated, or even QTime or QDate when a KDateTime::Spec is associated with.
The point is that a string without timezone can be useless depending on the 
context.

Please also consider this bug (http://bugs.kde.org/show_bug.cgi?id=140956) 
which could also benefit from the following for instance (I'm sure timezone 
are used everywhere)

So we would like to have in KLocale:
- formatDate, formatTime and formatDateTime(QDateTime) with an optional 
KDateTime::Spec argument. If specified and if this spec is not the local one, 
the timezone is appended to the returned string. 
But how should this be done regarding to timeFormat, dateFormat strings ?

- formatDateTime(KDateTime) as a little issue because it supports timezone 
thanks to an option, but if the KDateTime is date only, it calls formatDate 
which doesn't support timezone, which will return a date string without 
timezone which is incorrect.

Maybe this has nothing to do in KLocale and should stay in kdepimlibs as it is 
currently but I guess at least the timezone position in the string should be 
localized and configurable ?

I'd like to have feedback about this, especially because I'm not a KLocale 
specialist,

Thanks,
Bruno




More information about the kde-core-devel mailing list