Hi,

I think in most cases it's better to *not* convert the date/time to
UTC (Coordinated Universal Time) before storing, because of following
problem: Let's say you store a birthday in the database. After that,
you close the database, and move the database file to a different time
zone. Then you open the database and read the birthday. If the
date/time is converted to UTC, then the birthday might change, which
is completely unexpected. This is an extreme example (you could say
"birthdays don't contain the time"). But also for other cases it's
more common to store the date/time in the local time zone, so that
moving a database file will not change the value. Please note the
problem is only moving the database file.

I agree in some cases it would be better to convert the date to UTC,
but this you could also do in the application.

I think most databases ignore the time zone by default when using the
"normal" data types DATE, DATETIME, or TIMESTAMP (that means, the
value doesn't change if you move a database file to a different time
zone). If you think this isn't true please tell me which database, and
provide a reproducible test case. I'm very interested to make H2
compatible with other databases (I know some databases support
TIMESTAMP WITH TIME ZONE; this is not what I talk about - H2 simply
doesn't support storing the time zone - I'm talking about the normal
DATE, DATETIME and TIMESTAMP data types).

Regards,
Thomas

-- 
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To post to this group, send email to h2-datab...@googlegroups.com.
To unsubscribe from this group, send email to 
h2-database+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/h2-database?hl=en.

Reply via email to