ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Mayeul MARGUET" <mmarg...@aneo.fr>
Subject RE: Using non-default timezones
Date Wed, 07 Jun 2006 10:43:56 GMT
I personally would advise against storing dates as milliseconds since Epoch, especially when
these milliseconds are provided by an object that claims to use UTC timezone and its unpredictable
leap seconds.

But it probably is a pretty safe convention when only the same app is supposed to deal with
the database forever.

I am happy with the approach of passing and retrieving my dates directly as Strings to iBATIS
sql-map statements, forged to store and retrieve in the database as DATEs.

Now my problem is that I can't find a way to make it automagically with a custom typeHandler
on java.util.Date. Guess I'll have to look for more examples ^^.


-----Message d'origine-----
De : Wible, Thomas E [mailto:Thomas.E.Wible@mdnt.com] 
Envoyé : mercredi 7 juin 2006 12:28
À : Mayeul MARGUET; user-java@ibatis.apache.org
Objet : RE: Using non-default timezones

The only safe way is to store java.util.Date().getTime() as a long;-)

View raw message