H2 and timezones
H2 and timezones
- Subject: H2 and timezones
- From: Pascal Robert <email@hidden>
- Date: Mon, 07 Mar 2011 09:10:42 -0500
It look like H2 stores the time in the system's timezone instead of GMT. For example, a NSTimestamp which time is 13:40:58 Etc/GMT is stored as 08:40:58 because my system is set to America/Montreal (GMT -5). According to H2 documentation:
" If the time zone is not set, the value is parsed using the current time zone setting of the system. Date and time information is stored in H2 database files without time zone information. If the database is opened using another system time zone, the date and time will be the same. That means if you store the value '2000-01-01 12:00:00' in one time zone, then close the database and open the database again in a different time zone, you will also get '2000-01-01 12:00:00'. Please note that changing the time zone after the H2 driver is loaded is not supported. "
I really need to store the dates in GMT, or at least store the timezone offset, but I didn't find how to tell H2 to store it. I was thinking it might be because the formatter that ERH2PlugIn.formatValueForAttribute() calls is not storing the timezone offset, but when debugging, I don't even reach that formatter, so the problem doesn't seem to be there.
--
Pascal Robert
email@hidden
AIM/iChat : MacTICanada
LinkedIn : http://www.linkedin.com/in/macti
Twitter : pascal_robert
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden