2 Replies Latest reply on Dec 2, 2008 2:03 AM by 807589

    Date internationalization (i18n)

      I'm trying to get the UTC date in Java through the Calendar API and I simply can't get it to work.
      I am running a J2EE server with a persistence layer where it is critical that I store all Date objects in my database in UTC time. Is there an easy way to do this? I have tried something like:
      Calendar utc = Calendar.getInstance(TimeZone.getTimeZone("UTC");
      But when I print the time from that Calendar, I see that it is the same time as my local machine's time, which is GMT-8:00. How would I fix this to be accurate to UTC?