>Date now = Calendar.getInstance().getTime();
>
>And the Javadoc for Calendar.getInstance() is thus:
>     Gets a calendar using the default time zone and locale. The
Calendar returned is based on the current time in the >>default time
zone with the default locale.
>So something is amiss with Java's interpretation of the default time
zone.

Actually I ran into the same problem when I wrote the patch for
Importing/Exporting DialRules/Gateway/Schedules.

When I exported a schedule, it exported correctly. i.e I could see the
correct time in the csv file, but when I imported it, the time was out
by an hour. I had to do the following to correct this:

    SimpleDateFormat sdf = new SimpleDateFormat(HOUR_MINUTE,
Locale.getDefault());
    sdf.setTimeZone(TimeZone.getTimeZone(GMT));
    Date date;
    date = sdf.parse(timeReadFromCsvFile);

If I didn't set the TimeZone to GMT, then I got -1 hour when I read the
date.

Don't know if this could be used to fix your problem, but it fixed my
issue (note: I set the system to multiple timezones to make sure it
worked).
_______________________________________________
sipx-dev mailing list
[email protected]
List Archive: http://list.sipfoundry.org/archive/sipx-dev
Unsubscribe: http://list.sipfoundry.org/mailman/listinfo/sipx-dev

Reply via email to