my dog learned polymorphism
The moose likes Tomcat and the fly likes Tomcat showing wrong date Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat showing wrong date" Watch "Tomcat showing wrong date" New topic

Tomcat showing wrong date

Karthikean Konangi

Joined: Jan 31, 2008
Posts: 22

I am using Tomcat4.1.29 with Sun solaris 5.8. Operating system date is correct. But the taking by the Tomcat is wrong. its taking next day's date.
How can i get correct date from tomcat.
java.util.Date() in Servlet showing next day's date as current date.

Please help me in this.

Ben Souther

Joined: Dec 11, 2004
Posts: 13410

Are you sure it's a Tomcat problem and not a leap year bug in your application's code?

Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
Karthikean Konangi

Joined: Jan 31, 2008
Posts: 22
Dear Ben,

I am sure ,, this is not Leap year bug.

Even in log files, created by tomcat while server startup,,, its showing wrong date . But i donot know where exactly tomcat picking this date.
Even OS , applications out side of tomcat are Perfect. only Issue with applications running in this tomcat.
Karthikean Konangi

Joined: Jan 31, 2008
Posts: 22
Anybody please help me in this. How can i overcome this issue?
Can i get OS date in servlet? if yes , how can i?
William Brogden
Author and all-around good cowpoke

Joined: Mar 22, 2000
Posts: 13027
I vaguely recall a report of a leap year related problem in earlier versions of Java that got fixed in updates - is your Java updated to the latest version?

I agree. Here's the link:
subject: Tomcat showing wrong date
It's not a secret anymore!