I see the best option would be to have a timezone setting for the
user (along language ...) and then we fix up the dates according to
that setting.
What do you think ?
YEA! This is exactly what I wanted to do once ;-). Currently we are
storing the the users language and build a locale using this
information. You get this using MgnlContext.getLocale() for example.
If we would store not only the language but also the country
(fomratting) and maybe in addition timezone information, we could
create the users local better specified. The rendering and storing
code could use this locale then.
render a so stored date you just use UTC.
DateFormatUtils.formatUTC() does this for example. Well this is
the easiest approach for content.
No, I don't think users don't want to see and input their time in UTC.
A) I meant that in the most of the usecases you don't like to adjust
the date according to the timezone. A Japanese user enters 1.05.2006
10:22 and if I go to the rendered page as an American I will read
1.05.2006 10:22. The date is stored UTC: 1.05.2006 10:22.
--> it is a little bit like you would store the date as a string
B) But sure there are usecases where this would be false and you need
a correct handling of the timezone: A Japanese user enters 1.05.2006
10:22. An american sees: 1.05.2006 4:22. We store UTC:1.05.2006 12:22
(Attention: I used fantasy timezones here)
The problem is that this are completely different things. Where we
use A) for content edition we use B) for the modification date. The
best would be if one could define this on the date control.
But there we have a problem with the SaveHandler.
Solution for scheduled activation:
- get the date (stored with UTC as usual)
- manipulate the date so that it fits to the current timezone
Here, we may need to discuss on what the 'current' timezone is.
(See example above: if the admin instance is in Japan, and the
public site is in the US, or US time)
Well seams to get complex then. Perhaps we avoid this for 3.0 and
create a issue for 3.1
Regards,
Philipp Bracher
obinary ltd.
-----------------------------------------------------
[EMAIL PROTECTED] http://obinary.com
magnolia content management http://magnolia.info
-----------------------------------------------------
----------------------------------------------------------------
for list details see
http://www.magnolia.info/en/magnolia/developer.html
----------------------------------------------------------------