I have read postings about JVM time drift relative to OS time, but this problem seems different. My ISP running my JSP app insists the server time is accurate to within a second, but the times I'm getting in the app are off by 30 minutes or more. I've tried restarting the app which didn't help. I'm using tomcat-5.5.9 and jdk1.5.0. The following code illustrates the problem.
At 5:21 pm PST which by my watch is 8:21 pm PST, I ran the following Java
code (myTime is my Class that uses java.util.Calendar):
myTime time = new myTime();
log.debug(msgHdr +" MyTime with Calendar.getInstance(): "+
time.getDisplay());
long millis = System.currentTimeMillis();
log.debug(msgHdr +" System time in millis: "+ millis);
time.getMyTime().setTimeInMillis(millis);
log.debug(msgHdr +" MyTime with system time put in myTime calendar: "+
time.getDisplay());
The output I got is:
DEBUG - BGCC: TennisClub.scheduling.ScheduleBean MyTime with
Calendar.getIntance(): 8:59 PM
DEBUG - BGCC: TennisClub.scheduling.ScheduleBean System time in millis:
1202003941645
DEBUG - BGCC: TennisClub.scheduling.ScheduleBean MyTime with system time put
in myTime calendar: 8:59 PM
Therefore, the system time is 38 minutes ahead of the actual clock time?
Thanks.