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
Where LANGUAGE represents a two letter code as defined by the ISO-639 standard, COUNTRY represents a two letter code defined by the ISO-3166, and VARIANT represents a vendor or browser-specific code, for example WIN for Windows.

This parameter is optional.

To add this parameter:
  1. Drop the Format Date String function into the middle pane of the Mapping Editor.
  2. Double-click the function. The Function Properties pane opens.
  3. 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.



Feedback | Notices


Timestamp icon Last updated: Tuesday, 27 September 2016


http://pic.dhe.ibm.com/infocenter/wci/v7r0m0/topic/com.ibm.wci.doc/ref_Read_Date_String.html