• 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

Supress trailing Z in calendar object in XML

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

Scenario: I am trying to get a date value from database and set it into a VO and then finally set it into an XMLschema field.

The first out stmt prints: 2009-01-06 which is fine.
The second out stmt prints: 2009-01-06Z which may be expected but i dont want the trailing Z to be there. Basically, this system will be called by an external system. so i dont want the xml date to have this trailing Z in place.

Calendar cal = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
Date date = resultSet.getDate("billDate", Calendar.getInstance());
cal.setTime(date);
billDetailVO.setLatestBillDate(cal);
System.out.println("Recent Bill Date is - " + billDetailVO.getLatestBillDate().toString());

billDetailT.setLatestBillDate(billDetailVO.getLatestBillDate());
System.out.println("Recent Bill Date is - " + billDetailT.getLatestBillDate().toString());


Can someone help me here please. I am new to this area. Let me know if i have missed some information.
Also, Please let me know if this question does not belong in this section.

Thanks,
Reshma

 
reply
    Bookmark Topic Watch Topic
  • New Topic