Parse Date&Time

An alternative to the standard String to Date&Time node that can be used where the case of the supplied date/time string does not conform to that required by the Locale, or where dates may be in a variety of formats (with variation of separators and/or a mix of numeric and named months) whilst all conforming to a common sequence of day, month and year.

With the standard String to Date conversion nodes, if the Locale dictates that months are Jan, Feb, Mar etc, then the conversion would will fail if the months presented are JAN, FEB, MAR. This was the use case that the Parse Date&Time component was written, but the use case has been expanded a little... :-)

If both date and time are present, then currently they must follow the sequence DATE then TIME

Times may be entered in either 24 hour (0-23) or am/pm 1-12 format. These are the formats I am familiar with. If there is demand for alternative time formats, please contact me via the KNIME forum.




@takbb Brian Bates 22 May 2023

Options

Fail on Error
If set, the component will fail in the event that a conversion could not be determined
Columns to be converted to DateTime
Choose the columns to be converted to LocalDateTime
Two Digit Year Cut-off
Enter the two digit year, above which it will consider the year to be 19xx
Return DATE or DATETIME
Choose whether a DATE or a DATETIME is to be returned
Source Data date-field sequence
Specify the order of Day, Month and Year in your input data
Locale
Specify the required date locale for your region
Source Time (not currently configurable)
Specify the type of time (if present)
Date / Time order (not currently configurable)
Specify the order that Date and Time appears, if both appear in the data
Secondary Locale
Specify a second locale to try if the date does not parse with the first locale. This can be useful in cases where it is common for there to be a variation in data entry. %%00010%%00010For example, the locale for en-GB uses "Sept" as the abbreviation for September, whereas for en-US the abbreviation is "Sep". In the UK, some people will write Sept, and others may use "Sep", whilst for computational work, a standard 3 letter abbreviation for all months may be simpler. Therefore choosing a primary locale of en-GB and a secondary locale of en-US would allow both forms to be translated.
Output Field Suffix
A suffix that will be added to the end of the input column name to form the name of the output column

Input Ports

Icon
Data Table containing one or more String columns to be converted to Local DateTime or Local Date

Output Ports

Icon
Date Table with additional columns appended

Nodes

Extensions

Links