date - How to store java.util.sql to XMLGregorian Calendar -
i trying change format of xmlgregoriancalendar date. code in schema file(.xsd) this:
<xs:element name="latestsaledate"> <xs:annotation> <xs:documentation>latest sale date on property (format mm/dd/yyyy)</xs:documentation> </xs:annotation> <xs:simpletype> <xs:restriction base="xs:date"/> </xs:simpletype> </xs:element>
i created java classes xjc command
i got setter , getter set latestsaledate as:
@xmlelement(name = "latestsaledate") protected xmlgregoriancalendar latestsaledate;
but when trying date db , assign xmlgregoriancalendar object gives me illegalargumentexception
can here me how can solve , format write xml file in format dd/mm/yyyy
can here me how can solve , format write xml file in format dd/mm/yyyy
you can't , shouldn't - @ least not without changing schema. schema expressly specifies it's xs:date
- , specified format of xs:date
iso-8601 (yyyy-mm-dd, optional offset utc), not dd/mm/yyyy.
i suggest store data in standardized representation - don't forget user should never have see that; can parse/format date according user's culture, , store in iso-8601 format. it's important differentiate between storage/communication formats , presentation formats.
Comments
Post a Comment