I managed to fix the dates. Now Axis converts the Calendar-Objects to
GMT which is rather inconvenient
in my case. Is there a possibility to change that?
Thanks alot!
Am 02.09.2009 um 11:00 schrieb Moritz Mädler:
Hello,
after changing the Datefields in my WSDL to datetime (using POJO-
Class with java.util.Calendar)
Axis2 somehow returns the wrong date/time.
For example the Date/Time the POJO-Class logs is
-----
java.util.GregorianCalendar[time=1251829037000,areFieldsSet=true,areAllFieldsSet=true,lenient=true,zone=sun.util.calendar.ZoneInfo[id="GMT",offset=0,dstSavings=0,useDaylight=false,transitions=0,lastRule=null],firstDayOfWeek=1,minimalDaysInFirstWeek=1,ERA=1,YEAR=2009,MONTH=8,WEEK_OF_YEAR=36,WEEK_OF_MONTH=1,DAY_OF_MONTH=1,DAY_OF_YEAR=244,DAY_OF_WEEK=3,DAY_OF_WEEK_IN_MONTH=1,AM_PM=1,HOUR=6,HOUR_OF_DAY=18,MINUTE=17,SECOND=17,MILLISECOND=0,ZONE_OFFSET=0,DST_OFFSET=0]
----
The logged date was 2009-09-01 20:17:17.0
When I call the Webservice it returns:
<ax221:date_posted>2009-09-07T22:00:00.000Z</ax221:date_posted>
what is completely illogical.
The Code that sets this date_posted is
-----
Calendar cPosted = Calendar.getInstance();
cPosted.setTimeZone(TimeZone.getTimeZone("CEST"));
Date dPosted = rs.getTimestamp("date_posted");
cPosted.setTime(dPosted);
ac.setDate_posted(cPosted); // Container that carries the
Calendar-Object
-----
I already searched the web for solutions, but did not find anything.