• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

AXIS date issue

 
Ranch Hand
Posts: 83
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Ranch Hand
Posts: 72
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
You showed up just in time for the waffles! And this tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic