This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Supress trailing Z in calendar object in XML Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Supress trailing Z in calendar object in XML" Watch "Supress trailing Z in calendar object in XML" New topic

Supress trailing Z in calendar object in XML

Reshma Rangarajan

Joined: Nov 02, 2010
Posts: 8

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());
System.out.println("Recent Bill Date is - " + billDetailVO.getLatestBillDate().toString());

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.


I agree. Here's the link:
subject: Supress trailing Z in calendar object in XML
Similar Threads
xsd:date has trailing Z
Milliseconds from Current System Time
day light saving
Strange problem in date calculation (IS IT BUG!!!)
get time information from oracle DATE field