Timezone in Java

A customer just called asking why his ColdFusion sees the time as being UTC, while the rest of the system and his own tests seem to indicate that the system is properly set for Europe/Amsterdam. Apparantly, java (or at least Sun's JVM 1.4.2_09-b05, which is bundled with ColdFusion MX 7) only checks the system variable TZ to see which timezone it's in. Since ColdFusion is started from initscript, this variable is not set yet. It's in nearly the last of the init scripts.

So we had to add the following line to the initscript, somewhere near the beginning, to make sure ColdFusion uses the correct timezone:

export TZ="Europe/Amsterdam"

Thanks Geoff Mottram for pointing it out to me.

Comments

Comments powered by Disqus