This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Unmarshalling a date

 
J Hasenberg
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some XML that contains a date:
filter effectiveDate="2001-09-17T00:00:00.000-05:00" expirationDate="2001-08-23T00:00:00.000-05:00"
When the XML is unmarshalled using Castor, the object attribute containing the java.util.date, and subsequently the SQL that updates my database, is a day earlier than the XML. For instance the 2001-09-17 date in XML is now 2001-09-16. See below:
UPDATE ValueFilter SET effectiveDate='2001-09-16', expirationDate='2001-08-22' WHERE . . . )
Is there some kind of conversion being done for me by the JDK related to daylight savings time that might cause this? I am using the IBM JDK 1.3.1.
Any help as to why this is happening and how to avoid it would be greatly appreciated.
Thanks
 
Don't get me started about those stupid light bulbs.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic