This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
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


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Products » Tomcat
Bookmark "Tomcat showing wrong date" Watch "Tomcat showing wrong date" New topic
Author

Tomcat showing wrong date

Karthikean Konangi
Greenhorn

Joined: Jan 31, 2008
Posts: 22
Hi,

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.


Regards,
KonangiK
Ben Souther
Sheriff

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
Greenhorn

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
Greenhorn

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
Rancher

Joined: Mar 22, 2000
Posts: 12760
    
    5
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?

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Tomcat showing wrong date
 
Similar Threads
Date Conversion query
add one day to current date
Unable to see my Score at Sun Certification Database
thread's
getting wrong time from recieved message