STRTODATE

The STRTODATE function parses the input string for date and time data according to the specified Format and outputs the results as a time and date string of type DateTime.

Input/Output

Number of Connections: 1
InputData TypeDescription
Input1StringThe date and time string to be parsed.

OutputData TypeDescription
Output1DateTimeThe date and time value parsed from the input string.

Property

NameProperty TypeDescription
ModechoiceSpecifies whether the input string is formatted as a mail header value, or if it is a user-defined format.
Custom - The Format, TimeZone, and Locale are to be processed according to the user's specifications.
MailFormat - The input stream is handled using the Date field format as specified by RFC2822.
Formatchoice

Specifies the time pattern string. Reserved pattern letters are listed below:

You can specify the format directly except for pre-defined format. If use multiple format, these are applied sequentially until format the input string. For details of format, please refer the following topic "Date and Time Patterns".
yyyy/MM/dd HH:mm:ss - Example:2006/09/27 16:36:44
yyyy/MM/dd hh:mm:ss - Example:2006/09/27 04:36:44
yyyy/MM/dd - Example:2006/09/27
LocalechoiceDefines the locale.
System Locale [(default)] - The system's default locale is used.
TimeZonechoiceSpecifies the time zone.
System Timezone [(default)]
The system's default time zone is used.
(GMT) [(GMT)]
Greenwich Mean Time is used.
WhenInvalidchoiceSpecifies how processing is performed if the input stream cannot be handled according to the specified Format.
1970/01/01 [1970/01/01] - 1970/01/01 (the minimum value) is output.
Null [Null] - Null is output.
Input [Input] - The input value is output as is.
Exception [Exception] - An Exception is thrown.

Date and Time Patterns

It is described by combining the following letters.

SymbolMeaningMeaning
gEra nameHeisei
eYear corresponding to era name18
Gera designatorAD
yyear2003
Mmonth in yearJuly and 07
dday in month10
hhour in am/pm (1-12)11
Hhour in day (0-23)0
mminute in hour45
ssecond in minute54
Smillisecond955
Eday in weekTuesday
Dday in year145
Fday of week in month2 (2nd Wed in July)
wweek in year24
Wweek in month2
aam/pm markerPM
khour in day (1-24)24
Khour in am/pm (0-11)0
ztime zonePacific Standard Time
'escape for text
''single quote'

Example

PropertyOutput
Input12003/04/01Formatyyyy/MM/dd2003-04-01T00:00:00.000
LocaleSystem Locale
TimeZoneSystem Locale

PropertyOutput
Input1H190927FormatgeeMMdd2007-09-27T00:00:00.000
LocaleSystem Locale
TimeZoneSystem Locale

PropertyOutput
Input1平成元年09月27日Formatgggeeeee年MM月dd日1989-09-27T00:00:00.000
LocaleSystem Locale
TimeZoneSystem Locale

PropertyOutput
Input1平成19年09月27日Formatgggee年MM月dd日2007-09-27T00:00:00.000
LocaleSystem Locale
TimeZoneSystem Locale