You are viewing a plain text version of this content. The canonical link for it is here.
Posted to xmlbeans-user@xml.apache.org by "Murphy, Eric" <er...@pfc.cfs.nrcan.gc.ca> on 2004/05/11 22:43:46 UTC
Date format in output
Does anyone know how to influence the date format when an XML document is
written out? We have defined a date as follows:
xmlns:xs=http://www.w3.org/2001/XMLSchema
<xs:attribute name="reporting_date" type="xs:date" use="required"/>
A java.util.Calendar argument is required by the XML beans generated
setReportingDate(Calendar calendar) method. When the date is printed out in
the XML we get the year, month, date and a time.
We never set the time and when inspecting the original XML Beans
java.util.Calendar argument we see it has no time set in it. Yet this "time"
(which seems to be 7:00 or 8:00 depending on the month!) is printed out in
the XML when calling XmlObject.save(OutputStream, XmlOptions). Example
output:
reporting_date="2002-12-03-08:00"
Is there anyway we can get rid of the time in the XML output?
Eric Murphy
Software Developer (NFIS)
erimurph@pfc.forestry.ca
tel/t�l: 250-363-6038
fax / t�l�copieur 250-363-6004
Natural Resources Canada
Pacific Forestry Centre
506 West Burnside Road
Victoria BC V8Z 1M5
Ressources naturelles Canada
Centre de foresterie du Pacifique
506 rue Burnside ouest
Victoria, Colombie-Britanique V8Z 1M5