• 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:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

CMP bean and timezones

 
Ranch Hand
Posts: 195
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have a test client that I run on my machine that inserts a row into a database. My client machine is in Eastern Standard Time. My test program creates the date on the client, calls a session bean facade on the server, which is in GMT timezone, which in turns calls create on an Entity bean to insert the row into the database.
When the row gets inserted into the database, it is inserted in GMT (5 hours ahead of the date I created on the client). The session and entity bean are not doing any manipulation of the date, just passing it around, ultimately to the create method of the entity bean.
Where is the date getting converted from EST to GMT?
Thanks
Brian
 
Ranch Hand
Posts: 121
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
My guess is that because you are using dates the conversion from Eastern Time to GMT happens inside the Date object. I mean this is a great feature of the Date object that it can manipulate different timezones. You might try to use longs and only when storing the date this should be translated into a date object.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic