| WebSeitz/wikilog |
| Java Timezone Problem |
|
| last edited by BillSeitz on Aug 21, 2008 7:13 am |
I've inherited some JaVa code (plus stuff in other languages), and I'm not a Java guru.
I just discovered some messed-up behavior of the existing code.
A month back I realized that the server (RedHat) clock was set to [CST] Time Zone, which was not what I wanted. So I changed the system clock and hardware clock to [EST]. Data which was getting stuffed into Postgre S Q L by the Java code had the right zone timestamp on it.
But I was digging in more detail into the code the other day, and it seemed like the data was off by an hour. And when I looked at a log file that the code was writing, I saw all its timestamps labelled as [CST]!
I couldn't find any timezone objects in the code, nor any config stuff that would explain this behavior.
Could someone give me a hint as to what to look for? (I'll worry next about the timezone params getting passed to the db insert, but for now I think just getting the Java code to "think" in the same timezone as the rest of the server would be nice...)
a reference article --2003/12/26 18:20 [GMT]
by [Avi Abrami]
resolution - d'oh! --2004/01/03 00:57 [GMT]
It looks like the sysadmin had never restarted the JVM after the system time was changed. While it looked like the functionality was triggered by cron jobs, there was an underlying server stub ([Java Dynamic Management Kit]) that stayed resident. Once I killed the running java processes, and it restarted itself on schedule, everything was fine.
| See Back Links: z2003-12-25- Java Timezone Help | |
| User Options Recent Changes Help Page |