• 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

java.util.Date on different JVMs on different timezones

 
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
If I serialize a java.util.Date object, and send it to another JVM that's on a different time zone, will the time zones be automatically accounted for?

I'm assuming it does because in the JavaDocs, it says the Date object really just stores the milliseconds since 1/1/1970, 00:00:00 **GMT**. Theoretically, this means if I serialize a Date object that's 3pm Eastern Time, and send it to a JVM that's on Pacific Time, then printing out the date should show either 3pm Eastern Time, or 12pm Pacific Time, BUT NOT 3pm Pacific Time.

So that's the behavior I want, and it seems to behave that way according to the documentation and my understanding of Java. Does anyone see anything wrong with this?
 
reply
    Bookmark Topic Watch Topic
  • New Topic