|
View:
New views
2 Messages
—
Rating Filter:
Alert me
|
|
|
Question of dateFormat in XMLBeansWe are using XML
Beans in our application.
Our schema uses
Here is our
schema for datetime:
<xs:simpleType name="UTCTimestamp">
<xs:annotation> <xs:documentation>String representing Time/date combination represented in UTC (Universal Time Coordinated, also known as “GMT”) in either YYYYMMDD-HH:MM:SS (whole seconds) or YYYYMMDD-HH:MM:SS.sss (milliseconds) format, colons, dash, and period required. Valid values: * YYYY = 0000-9999, MM = 01-12, DD = 01-31, HH = 00-23, MM = 00-59, SS = 00-60 (60 only if UTC leap second) (without milliseconds). * YYYY = 0000-9999, MM = 01-12, DD = 01-31, HH = 00-23, MM = 00-59, SS = 00-60 (60 only if UTC leap second), sss=000-999 (indicating milliseconds). Leap Seconds: Note that UTC includes corrections for leap seconds, which are inserted to account for slowing of the rotation of the earth. Leap second insertion is declared by the International Earth Rotation Service (IERS) and has, since 1972, only occurred on the night of Dec. 31 or Jun 30. The IERS considers March 31 and September 30 as secondary dates for leap second insertion, but has never utilized these dates. During a leap second insertion, a UTCTimestamp field may read "19981231-23:59:59", "19981231-23:59:60", "19990101-00:00:00". (see http://tycho.usno.navy.mil/leapsec.html) </xs:documentation> </xs:annotation> <xs:restriction base="xs:dateTime" /> </xs:simpleType>
<xs:simpleType name="TransactTime_t">
<xs:annotation> <xs:documentation xml:lang="en"> Time of execution/order creation (expressed in UTC (Universal Time Coordinated, also known as "GMT") </xs:documentation> <xs:appinfo> <fm:Xref Protocol="FIX" name="TransactTime" tag="60" datatype="UTCTimestamp" ComponentType="Field" StdAbbrev="TxnTm" Category="" CategoryAbbrev="" /> </xs:appinfo> </xs:annotation> <xs:restriction base="UTCTimestamp" /> </xs:simpleType> I believe that
internally it uses XmlCalender class to set the value for transaction
time.
Here is my
implementation:
public
void setTransactionTime(Calendar transactionTime)
{ if (transactionTime != null) { transactionTime.clear(Calendar.MILLISECOND); _message.setTxnTm(transactionTime); } else if ( _message.isSetTxnTm() ) { _message.unsetTxnTm(); } } We need this field
in the format of 2008-06-30T13:26:20-0500
But I am getting the
value in the format of 2008-06-30T13:26:20-05:00
I would like to
remove colon (:) from timezone difference.
Does any body have
any idea how to get datetime field in custom format?
Thanks Vijaya
Manne Production Issues Logging
https://www.theice.com/integrate This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired. |
|||||||||||
|
|
Re: Question of dateFormat in XMLBeansIf you are talking about Java then use the SimpleDateFormat class to format. If you are talking about W3 Schema then it only accepts the "colon" date format. If you need it without you would need to store it in an xs:string with regular expression restriction rather than a xs:dateTime. If need be you can massage it from one to the other in XSL. Pete PETE VAN DE WATER Java Developer VTech - Business Technology New Zealand Vero Insurance New Zealand Limited p +64 9 363 2518 x 632 518 m +64 21 226 6228 e peter_van_de_water@... www.vero.co.nz
We are using XML Beans in our application. Our schema uses Here is our schema for datetime: <xs:simpleType name="UTCTimestamp"> <xs:annotation> <xs:documentation>String representing Time/date combination represented in UTC (Universal Time Coordinated, also known as “GMT”) in either YYYYMMDD-HH:MM:SS (whole seconds) or YYYYMMDD-HH:MM:SS.sss (milliseconds) format, colons, dash, and period required. Valid values: * YYYY = 0000-9999, MM = 01-12, DD = 01-31, HH = 00-23, MM = 00-59, SS = 00-60 (60 only if UTC leap second) (without milliseconds). * YYYY = 0000-9999, MM = 01-12, DD = 01-31, HH = 00-23, MM = 00-59, SS = 00-60 (60 only if UTC leap second), sss=000-999 (indicating milliseconds). Leap Seconds: Note that UTC includes corrections for leap seconds, which are inserted to account for slowing of the rotation of the earth. Leap second insertion is declared by the International Earth Rotation Service (IERS) and has, since 1972, only occurred on the night of Dec. 31 or Jun 30. The IERS considers March 31 and September 30 as secondary dates for leap second insertion, but has never utilized these dates. During a leap second insertion, a UTCTimestamp field may read "19981231-23:59:59", "19981231-23:59:60", "19990101-00:00:00". (see http://tycho.usno.navy.mil/leapsec.html) </xs:documentation> </xs:annotation> <xs:restriction base="xs:dateTime" /> </xs:simpleType> <xs:simpleType name="TransactTime_t"> <xs:annotation> <xs:documentation xml:lang="en"> Time of execution/order creation (expressed in UTC (Universal Time Coordinated, also known as "GMT") </xs:documentation> <xs:appinfo> <fm:Xref Protocol="FIX" name="TransactTime" tag="60" datatype="UTCTimestamp" ComponentType="Field" StdAbbrev="TxnTm" Category="" CategoryAbbrev="" /> </xs:appinfo> </xs:annotation> <xs:restriction base="UTCTimestamp" /> </xs:simpleType> I believe that internally it uses XmlCalender class to set the value for transaction time. Here is my implementation: public void setTransactionTime(Calendar transactionTime) { if (transactionTime != null) { transactionTime.clear(Calendar.MILLISECOND); _message.setTxnTm(transactionTime); } else if ( _message.isSetTxnTm() ) { _message.unsetTxnTm(); } } We need this field in the format of 2008-06-30T13:26:20-0500 But I am getting the value in the format of 2008-06-30T13:26:20-05:00 I would like to remove colon (:) from timezone difference. Does any body have any idea how to get datetime field in custom format? Thanks Vijaya Manne Production Issues Logging This message may contain confidential information and is intended for specific recipients unless explicitly noted otherwise. If you have reason to believe you are not an intended recipient of this message, please delete it and notify the sender. This message may not represent the opinion of IntercontinentalExchange, Inc. (ICE), its subsidiaries or affiliates, and does not constitute a contract or guarantee. Unencrypted electronic mail is not secure and the recipient of this message is expected to provide safeguards from viruses and pursue alternate means of communication where privacy or a binding message is desired.
|
| Free Forum Powered by Nabble | Forum Help |