Timestamp Extraction Processor

Modified on Tue, 30 Nov 2021 at 02:33 PM

Overview

Timestamp Extraction Processor extracts certain time information (e.g., hour of the day, day of the week) from a datetime column.


Input

The processor can work on any dataset containing a timestamp column.

Configuration


Timestamp Column

Select the timestamp column from which the information should be extracted. 


Extraction Methods

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
  • Year

Prefix

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.


Output

The processor output is the input dataset containing a new column for every selected method. The columns are named "prefix_extraction_method".


Example

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. 


Example Input


Workflow



Example Configuration



Result

This is a snippet of the output dataset:


The results for all extraction methods used on the first datetime value:

Extraction MethodFor example Value: 2020-02-14 04:45:00.0
Date with time in seconds1581655500

Date without time

2020-02-14

Date without time in seconds

1581638400
Day of Month14
Day of the week5

Day of the week as Text

Friday
Hour of the day4
Is working day1
Month of the year2

Month of the year as Text

February
Week of the year7

Year and month in the format yyyy-MM

2020-02
Year
2020



Related Articles

Timestamp Difference Processor

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article