File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Tomcat showing wrong date/time
Joined: Jul 25, 2005
Aug 21, 2007 03:52:00
Funny thing happened today.
services was carrying out
on apps deployed on
5.5, which OS and JVM have been patched for the new DST times for New Zealand. Our new DST starts at 2am Oct 1st.
After patching both the JVM and OS they moved the date on the server (Solaris 9) forward to Oct 1st, and opened a page from the application that was deployed on Tomcat.
The page (jsp) shows a date and time on a using
Funnily enough the above code showed the date and time that matched the client machine's date/time, and not the server's.
Thus it showed 21 August 2007 and not 1 October 2007.
This was rectified by restarting Tomcat. However I'm curious to find out why/how Tomcat was holding to the previous date/time.
Any idea? Thanks for your opinions.
Joan Horta Tosas
Joined: Feb 01, 2007
Sep 03, 2007 02:49:00
That's because the Java classes for the Date used by the session where loaded before the change. Java classes are not hot redeployable, just some application/web servers do redeploys and only in some especific dirs.
subject: Tomcat showing wrong date/time
Problem with "America/Los_Angeles" Time Zone
How does Java time work?
auto deploy and change to DST time
10000 milliseconds showing as 01:00:10.000 - why ?
Dates in Java
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014