cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Lothar Krenzien <>
Subject <kein Betreff>
Date Mon, 04 Dec 2006 17:06:12 GMT
Hi there,

I would like to know how cayenne handles values. 

My problem is, that I have to import xml files with datetime values of different timezones.
For example the file consits the following tag: date="30.11.2006 22:14:28". In my case it
should represents a datetime value of german format (dd.MM.yyyy BUT in local korean
time. Korean time has an offset of +9h to GMT. So in GMT the time part is "13:14:28" and in
german time (GMT +1h) it's "15:14:28". For some "historical" reasons I have to persistent
the local datetime value ("28.10.2006 22:14:28"), but of course as date object instead of
a string value
When I now try to convert the string value into a date-object using standard java methods
I will get an object which reflects GMT time. But when I try to print it out on the console
it will be converted to local date (thus german date). And that date will be saved by cayenne
in the database. So for me it looks like  that cayenne tries to call toString() on the date
object and will get a recalculated date instead of the original date. If it's true I think
it would be better to use a SimpleDateFormatter instance because than the you will get a correct
datetime string.

I've provided a simple demo class to show what I mean. I used Java 5, cayenne 2.1 and jtds
with MS SQL Server 2000.


"Ein Herz für Kinder" - Ihre Spende hilft! Aktion:
Unser Dankeschön: Ihr Name auf dem Segel der 1. deutschen America's Cup-Yacht!

  • Unnamed multipart/mixed (inline, None, 0 bytes)
View raw message