Read Date String function
The Read Date String function converts a string (that contains a date and time) to the XML Schema data type: xs:dateTime.
Purpose
Parameter: string
The date and time as a string.
Parameter: string
This string defines the format
of the date and time string of the first parameter. For example, the
format string could be equal to MM/dd/yyyy. For more information about
the supported date and time pattern strings see SimpleDateFormat class
in the Sun J2SE 1.4.2 Javadoc: http://www.science.uva.nl/ict/ossdocs/java/jdk1.3/docs/api/java/text/SimpleDateFormat.html.
Pattern Letter | Description | Example1 | Example2 |
---|---|---|---|
G | Era designation | AD | BC |
y | Year | 2004 | 2001 |
M | Month in a year | April | 04 |
w | Week in a year | 12 | 24 |
W | Week in a month | 3 | 1 |
D | Day in a year | 234 | 333 |
d | Day in a month | 13 | 20 |
F | Day of week in a month | 1 | 3 |
E | Day in a week | Monday | Friday |
a | AM or PM designation | AM | PM |
H | Hour in a day - a number between 0 and 23 | 12 | 13 |
k | Hour in a day - a number between 1 and 24 | 14 | 23 |
K | Hour in AM or PM - a number between 0 and 11 | 0 | 10 |
h | Hour in AM or PM - a number between 1 and 12 | 11 | 12 |
m | Minute in an hour | 20 | 50 |
s | Second in a minute | 10 | 30 |
S | Milliseconds | 224 | 338 |
z | Time zone in General time zone designation | PDT | EDT |
Z | Time zone in RFC 822 time zone designation | -0300 | +0200 |
Parameter: string (Optional)
This string defines the locale. For example, the English United States locale is defined with the following string: en_US.
The locale string can be defined by any of the following formats:
- LANGUAGE
- LANGUAGE_COUNTRY
- LANGUAGE_COUNTRY_VARIANT
This parameter is optional.
To add this parameter:
- Drop the Format Date String function into the middle pane of the Mapping Editor.
- Double-click the function. The Function Properties pane opens.
- Click Add. The Locale input parameter shows in the list of parameters.
Returns: dateTime
The date and time as an XML Schema data type: xs:dateTime is returned. For example, if the Read Date String function was run with the following input parameters:
date and time string: 02/22/2005/12/20/44
format string: MM/dd/yyyy/HH/mm/ss
A dateTime representing February 22, 2005 at 12:20 and 44 seconds is returned from Read Date String Function.