• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

AXIS date issue

 
Amit G Piplani
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
DOes AXIS automatically converts the date in GMT TimeZone and send accross at the time of hitting web service?

AMit
 
Ashutosh Shahi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yep,
dateTime is always sent in GMT Timezone over the wire

Once you receive the dateTime in a java.util.Calendar, doing:
calendar.setTimeZone(java.util.TimeZone.getDefault());
gives back the date to u according to your current localization settings.

Ashutosh
 
Amit G Piplani
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ashutosh,
Thanks for your reply but chnages suggested by you are at the receiving hand of Web Service.
Can you send me the link where it says datetime/Calendar is always send across in GMT?

Amit
 
Kuldeep Vaishnav
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
yes i think what Ashutosh is saying is correct.we had a similar problem between java layer and db2 few days ago with sql date.One suggestion is to write a util method which sets the date to GMT noon and then use the method at each end point before sending the data.The date and hrs will not change.hope this helps.somethin like followin........

public static java.sql.Date getGMTNoon( java.util.Date dt)
{
XYZCalendar cal = new XYZCalendar(dt.getTime());
cal.setGMTNoon();
return cal.getSqlDate();
}

u can change the date type to suit ur needs.
 
Kuldeep Vaishnav
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
sorry...XYZCalendar is a custom class which extends java.Calendar...but u can use java calendar directly too...
 
Ashutosh Shahi
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Amit,
I don't have a link, but I have confirmed it. And its pretty logical stuff to do, coz ur webservice can be anywhere in world, and can be accessed from anywhere, so obviously it can't assume what timezone is used rather than using something standard. If its not doing that, then the webservice has a bug.
Ashutosh
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic