public class XsDateTimeConversion
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
protected java.util.GregorianCalendar |
cal
Calendar instance used for calculating dates for timestamps
|
protected java.text.SimpleDateFormat |
dfMillisTZone
Date/Time parsing instance with milliseconds and time zone information.
|
protected static java.lang.String |
XSDATETIME_FORMAT_STRING_MILLIS_TZONE
Date/Time parsing format including milliseconds and time zone
information.
|
protected java.util.regex.Pattern |
xsDtPattern
Pattern used for matching the XsDateTime formatted timestamp strings.
|
Constructor and Description |
---|
XsDateTimeConversion() |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
format(java.util.Date date)
Formats a given date to the xs:dateTime format of XML.
|
java.util.Date |
parseXsDateTime(java.lang.String xsDateTime)
Expects an XML xs:dateTime lexical format string, as in
2005-10-24T11:57:31.000+01:00 . |
protected static final java.lang.String XSDATETIME_FORMAT_STRING_MILLIS_TZONE
protected final java.text.SimpleDateFormat dfMillisTZone
protected final java.util.regex.Pattern xsDtPattern
protected java.util.GregorianCalendar cal
public java.util.Date parseXsDateTime(java.lang.String xsDateTime)
2005-10-24T11:57:31.000+01:00
. Some bad MXML files miss
timezone or milliseconds information, thus a certain amount of tolerance
is applied towards malformed timestamp string representations. If
unparseable, this method will return null
.xsDateTime
- Timestamp string in the XML xs:dateTime format.public java.lang.String format(java.util.Date date)
date
- Date to be formatted.