Sunday, 5 August 2007
Java Timezone Wrong on Fedora
« Particles | Main | Excluding Unfixables from Eclipse Problem View »
How's this for annoying:
bash$ groovy -e "println new java.util.Date()" Mon Aug 06 01:40:33 EDT 2007 bash$ date Mon Aug 6 00:40:35 CDT 2007 bash$ /usr/sbin/zdump /etc/localtime /etc/localtime Mon Aug 6 00:41:45 2007 CDT bash$ cat /etc/timezone America/ChicagoThis is on Fedora. Java seems to have decided I'm on the east coast, and stubbornly refuses to look at any of the many sources where it could determine that I'm in the central timezone. To save you some trouble, here's the solution:
bash$ export TZ="US/Central" bash$ groovy -e "println new java.util.Date()" Mon Aug 06 00:49:02 CDT 2007To make this automatic, I added the export TZ line to /etc/profile.d/java.sh , which is where I set my JAVA_HOME, ANT_HOME, GROOVY_HOME and so on.
Technorati Tags: java annoyance bug
Posted by at 7:48 PM in stuff about java
[Trackback URL for this entry]
