1 Reply Latest reply: Jul 19, 2006 4:21 PM by Ward Flores-Oracle RSS

    time zones with webservices toolkit

    476550
      hello

      I was wondering how people were coping with timezones?
      I'm creating a calendar object like so

      TimeZone localTimezone = TimeZone.getDefault(); //dead on GMT for me
      Calendar today = CalendarUtils.getToday(localTimezone);

      but on sending a soap request all my returning events are coming back an hour earlier because of day light saving. localTimezone.GetDSTSavings(); returns 3600000.

      How should I cope with this?
      I presume that the time zone I set in my Calendars passed to my vQuery determine the dates that are returned? or maybe not?

      Can I get the server to return the actuall correct times or do I need to add on the DSTSavings after getting my vEvents?

      Cheers for any advice
        • 1. Re: time zones with webservices toolkit
          Ward Flores-Oracle
          Hi,

          You can do as follows:

          # date
          Calendar today = CalendarUtils.getToday();
          String ret_date = CalendarUtils.getUTCDate(today);

          # date and time
          Calendar today = CalendarUtils.getToday();
          today.set(Calendar.HOUR_OF_DAY, m_time); // where m_time is an int value
          String ret_datetime = CalendarUtils.getUTCDateTime(today);

          Hope this helps.