• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Junilu Lacar
  • Rob Spoor
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Tim Moores
  • Jesse Silverman
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Piet Souris
  • Frits Walraven

Unmarshalling a date

 
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
reply
    Bookmark Topic Watch Topic
  • New Topic