Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UTC format date in XML- Help!!

 
maoushuk Imran
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to set the date in UTC to the xml beans which in turn to be sent to other platform through webservices. I am using
objCal = Calendar.getInstance(TimeZone.getTimeZone("UTC"));
for the objCal i am setting my date
objCal .setTime(objDocHeaderBean.getCreationDate());
if i print the date i am getting the date in required format ie Wed Jul 01 12:39:25 GMT 2009 but after setting it to xmlbeans the format is not same i am getting 2009-07-01T00:00:00.000+00:00. But iwant my previous format to be sent. I tried a lot . Can anyone help on this???
 
maoushuk Imran
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please help on this. I ve to finish it by tomorrow. Am trying for the past 2 days.
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Maoshuk,
the latter format seems to be the correst XSD format and is probably the correct format to be sent through xml web services.

To get the the format you prefer you may have to use a calendar and format the date at the other end.

Also it would help if you could describe "why" you want that particular format to be sent in xml.
 
maoushuk Imran
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Latter format is one which the end user wants ie that is the format the service requestor needs while sending through webservices
 
Gamini Sirisena
Ranch Hand
Posts: 378
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am not familiar with xmlbeans. But I guess you use an xml schema to generate some java xml beans?

Then may be a modification to the schema "if possible" to change the xsd data type from date/time to string may have a probability of working.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic