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
| Input | Data Type | Description |
| Input1 | String | The date and time string to be parsed. |
| Output | Data Type | Description |
| Output1 | DateTime | The date and time value parsed from the input string. |
Property
| Name | Property Type | Description |
| Mode | choice | Specifies 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.
|
|
| Format | choice |
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
|
|
| Locale | choice | Defines the locale.
| System Locale [(default)]
| - |
The system's default locale is used.
|
|
| TimeZone | choice | Specifies the time zone.
- System Timezone [(default)]
-
The system's default time zone is used.
- (GMT) [(GMT)]
-
Greenwich Mean Time is used.
|
| WhenInvalid | choice | Specifies 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.
|
|
It is described by combining the following letters.
| Symbol | Meaning | Meaning |
| g | Era name | Heisei |
| e | Year corresponding to era name | 18 |
| G | era designator | AD |
| y | year | 2003 |
| M | month in year | July and 07 |
| d | day in month | 10 |
| h | hour in am/pm (1-12) | 11 |
| H | hour in day (0-23) | 0 |
| m | minute in hour | 45 |
| s | second in minute | 54 |
| S | millisecond | 955 |
| E | day in week | Tuesday |
| D | day in year | 145 |
| F | day of week in month | 2 (2nd Wed in July) |
| w | week in year | 24 |
| W | week in month | 2 |
| a | am/pm marker | PM |
| k | hour in day (1-24) | 24 |
| K | hour in am/pm (0-11) | 0 |
| z | time zone | Pacific Standard Time |
| ' | escape for text |
|
| '' | single quote | ' |
- It becomes the era name of the alphabet one character when the number of pattern characters of the era name is one, it becomes the era name of the Chinese character one character in case of two, and it becomes the era name of the Chinese character two characters in case of three or more. For example, in the case of "平成", each output becomes "H", "平", and "平成"
- When the number of era name year's pattern characters is three or less, it becomes the number of minimum digits as usual, and it becomes one character of former ''for one year it and other ages become the numbers of minimum digits in which three is subtracted in case of four or more.
- Era name year's pattern character doesn't correspond to the Chinese numerals.
- When "z" is not used, it interprets it as a date in the time specified with TimeZone. When "z" is used, TimeZone is ignored.
- For more details on the format syntax, please refer to the SimpleDateFormat class documentation.
Example
| Property | Output |
| Input1 | 2003/04/01 | Format | yyyy/MM/dd | 2003-04-01T00:00:00.000 |
| | Locale | System Locale | |
| | TimeZone | System Locale | |
| Property | Output |
| Input1 | H190927 | Format | geeMMdd | 2007-09-27T00:00:00.000 |
| | Locale | System Locale | |
| | TimeZone | System Locale | |
| Property | Output |
| Input1 | 平成元年09月27日 | Format | gggeeeee年MM月dd日 | 1989-09-27T00:00:00.000 |
| | Locale | System Locale | |
| | TimeZone | System Locale | |
| Property | Output |
| Input1 | 平成19年09月27日 | Format | gggee年MM月dd日 | 2007-09-27T00:00:00.000 |
| | Locale | System Locale | |
| | TimeZone | System Locale | |