2 Replies Latest reply: Dec 1, 2008 8:03 PM by 807589 RSS

    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?