Skip to Main Content

Java Programming

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Java Class Date() showing wrong year!

Daniel-ShDec 31 2013 — edited Jan 7 2014

Hi,

Today I encountered a weird problem at work. We use a Java program to read an XML file and put its content into a database. We also use Date() to get the current date and insert it into a field in database with content from XML file. Everything worked flawlessly until today, the last day of 2013. We are getting 2014 for the year instead of 2013!!! System date shows correct year, so this must not be an issue.

Any idea why this is happening?!

I appreciate your inputs.

Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 4 2014
Added on Dec 31 2013
5 comments
4,038 views