Timestamp Extraction Processor extracts certain time information (e.g., hour of the day, day of the week) from a datetime column.
The processor can work on any dataset containing a timestamp column.
Select the timestamp column from which the information should be extracted.
Choose the extraction methods for the given timestamps. Each method extracts a certain part of the timestamp:
- Date with time in seconds
- Date without time
- Date without time in seconds
- Day of month
- Day of the week
- Day of the week as Text
- Hour of the day
- Is working day (1 if yes, 0 if not)
- Month of the year
- Month of the year as Text
- Week of the year
- Year and month in the format yyyy-MM
Choose a prefix for the newly extracted columns. The prefix needs to start with a letter and may only contain characters that are valid in column names (e.g. "abc_" would be a valid prefix, and "123" would be invalid)
If no prefix is chosen only the extraction methods will be used as column names.
The processor output is the input dataset containing a new column for every selected method. The columns are named "prefix_extraction_method".
In this example we take a table that contains two datetimes as strings (text). We pass it to a Data Type Conversion Processor to convert the input to type datetime. Then we want to get the values of every extraction method of the Timestamp Extraction Processor and save them into a Result Table.
This is a snippet of the output dataset:
The results for all extraction methods used on the first datetime value:
|Extraction Method||For example Value: 2020-02-14 04:45:00.0|
|Date with time in seconds||1581655500|
Date without time
Date without time in seconds
|Day of Month||14|
|Day of the week||5|
Day of the week as Text
|Hour of the day||4|
|Is working day||1|
|Month of the year||2|
Month of the year as Text
|Week of the year||7|
Year and month in the format yyyy-MM