Hi

Thomas, the problem you are talking about only exists when dealing with date values without time, like "1982-01-01", not for Timestamp values.

We could store timestamps internally as a long value, defined in the same way as that System.currentTimeMillis is defined i.e. milliseconds since 1 Jan 1970 GMT.
Then there are no daylight saving or midnight problems, because by definition 
it is unambiguous.

See here for a fuller explanation:
http://en.wikipedia.org/wiki/Unix_time
http://en.wikipedia.org/wiki/Coordinated_Universal_Time

Regards, Noel.

On 2014-05-06 07:57, Thomas Mueller wrote:
Hi,

There are various problems when using java.util.Data / java.sql.Date / Time / 
Timestamp and java.util.Calendar, mainly
because of the daylight time saving changes. For example, you can't assume a 
certain date (if you don't care about the
time) is "midnight", because in some timezones, for some days, midnight doesn't 
exist because it's the daylight time
saving border. It's not a problem in most timezones, but it is in some.

Regards,
Thomas




On Monday, May 5, 2014, Noel Grandin <[email protected] 
<mailto:[email protected]>> wrote:

    I'm curious - why do we not simply store date and time in UTC format?
    i.e. in milliseconds since 1 Jan 1970?

    That's pretty much a universal format these days, and then we can
    convert to whatever the local time zone is when we convert the value
    to string.
    If necessary, I could create an extra data type to represent time like this?

    I know I would use it, since that's how we represent all our data.

    --
    You received this message because you are subscribed to the Google Groups "H2 
Database" group.
    To unsubscribe from this group and stop receiving emails from it, send an 
email to
    [email protected] <javascript:;>.
    To post to this group, send email to [email protected] 
<javascript:;>.
    Visit this group at http://groups.google.com/group/h2-database.
    For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to
[email protected] 
<mailto:[email protected]>.
To post to this group, send email to [email protected] 
<mailto:[email protected]>.
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "H2 
Database" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/h2-database.
For more options, visit https://groups.google.com/d/optout.

Reply via email to