Dates processor
The Dates processor allows you to perform different operations on columns with date or timestamp data in a transformation flow.
To rename the processor, click the Edit icon that is displayed when hovering over the default name of the processor.
To edit its description, click the Edit icon that is displayed when hovering over Description.
For information about patterns to use for date and time input, please check the vendor documentation for the data platform that you are using in the project.
Compare dates
You can compare a date value in a column with the value in another date column or a specified date. The output value is a boolean representation of the comparison.
-
Select Compare dates in Function name.
-
Select which operator to use when comparing the dates, for example, equals or before, in Compare mode.
-
Select which column to use when comparing dates in Column to process.
-
Select what to compare with in Use with.
-
Value lets you compare with a fixed value.
Set the date and time to compare with in Value. The input format is: yyyy-MM-DD HH:mm
-
Column compares with the value of another column in the dataset.
Set the column to compare with in Column.
-
-
Enter the name of the new column in New column name.
-
Click Apply.
Convert to date
If you have a column with a data type other than date, but that contains date values, you can convert it to a date.
-
Select Convert to date in Function name.
-
Select which column to convert in Column to process.
-
Set the format of the input date in Input format.
-
Auto will attempt to recognize the date format automatically.
-
Custom lets you set the format pattern of the input date.
Set the pattern in Input date pattern.
-
-
Select Create new column if you want to store the results in a new column. Otherwise the results are stored in the same column.
Enter the name of the new column in New column name.
-
Click Apply.
Convert to datetime
If you have a column with a data type other than datetime, but that contains datetime values, you can convert it to a datetime.
-
Select Convert to datetime in Function name.
-
Select which column to convert in Column to process.
-
Set the format of the input datetime in Input format.
-
Auto will attempt to recognize the datetime format automatically.
-
Custom lets you set the format pattern of the input datetime.
Set the pattern in Input date pattern.
-
-
Select Create new column if you want to store the results in a new column. Otherwise the results are stored in the same column.
Enter the name of the new column in New column name.
-
Click Apply.
Convert to time
If you have a column with a data type other than time, but that contains time values, you can convert it to a time.
-
Select Convert to time in Function name.
-
Select which column to convert in Column to process.
-
Set the format of the input timestamp in Input format.
-
Auto will attempt to recognize the timestamp format automatically.
-
Custom lets you set the format pattern of the input timestamp.
Set the pattern in Input date pattern.
-
-
Select Create new column if you want to store the results in a new column. Otherwise the results are stored in the same column.
Enter the name of the new column in New column name.
-
Click Apply.
Create date from parts
You can create a date from parts that can either be a set value, or a column value. The date is stored in a new column.
-
Select Create date from parts in Function name.
-
Set the year part.
Select if you want to set a fixed value, or a column value in Year.
-
If you selected Value, enter a year value in Year value.
-
If you selected Column, select which column to use in Year column.
-
-
Set the month part.
Select if you want to set a fixed value, or a column value in Month.
-
If you selected Value, enter a month value in Month value.
-
If you selected Column, select which column to use in Month column.
-
-
Set the day part.
Select if you want to set a fixed value, or a column value in Day.
-
If you selected Value, enter a day value in Day value.
-
If you selected Column, select which column to use in Day column.
-
-
Enter the name of the new column in New column name.
-
Click Apply.
Create time from parts
You can create a time from parts that can either be a set value, or a column value. The time is stored in a new column.
-
Select Create time from parts in Function name.
-
Set the hours part.
Select if you want to set a fixed value, or a column value in Hours.
-
If you selected Value, enter an hours value in Hours value.
-
If you selected Column, select which column to use in Hours.
-
-
Set the minutes part.
Select if you want to set a fixed value, or a column value in Minutes.
-
If you selected Value, enter a minutes value in Minutes value.
-
If you selected Column, select which column to use in Minutes column.
-
-
Set the seconds part.
Select if you want to set a fixed value, or a column value in Seconds.
-
If you selected Value, enter a seconds value in Seconds value.
-
If you selected Column, select which column to use in Seconds column.
-
-
Set the milliseconds part.
Select if you want to set a fixed value, or a column value in Milliseconds.
-
If you selected Value, enter a milliseconds value in Milliseconds value.
-
If you selected Column, select which column to use in Milliseconds column.
-
-
Enter the name of the new column in New column name.
-
Click Apply.
Create datetime from parts
You can create a datetime from parts that can either be a set value, or a column value. The datetime is stored in a new column.
-
Select Create datetime from parts in Function name.
-
Set the year part.
Select if you want to set a fixed value, or a column value in Year.
-
If you selected Value, enter a year value in Year value.
-
If you selected Column, select which column to use in Year column.
-
-
Set the month part.
Select if you want to set a fixed value, or a column value in Month.
-
If you selected Value, enter a month value in Month value.
-
If you selected Column, select which column to use in Month column.
-
-
Set the day part.
Select if you want to set a fixed value, or a column value in Day.
-
If you selected Value, enter a day value in Day value.
-
If you selected Column, select which column to use in Day column.
-
-
Set the hours part.
Select if you want to set a fixed value, or a column value in Hours.
-
If you selected Value, enter an hours value in Hours value.
-
If you selected Column, select which column to use in Hours column.
-
-
Set the minutes part.
Select if you want to set a fixed value, or a column value in Minutes.
-
If you selected Value, enter a minutes value in Minutes value.
-
If you selected Column, select which column to use in Minutes column.
-
-
Set the seconds part.
Select if you want to set a fixed value, or a column value in Seconds.
-
If you selected Value, enter a seconds value in Seconds value.
-
If you selected Column, select which column to use in Seconds column.
-
-
Enter the name of the new column in New column name.
-
Click Apply.
Truncate date
You can truncate date field to exclude a date or time part.
-
Select Truncate date in Function name.
-
Select which date column to truncate in Column to process.
-
Select which date or time part to truncate in Date or time part.
-
Select Create new column if you want to store the results in a new column. Otherwise the results are stored in the same column.
Enter the name of the new column in New column name.
-
Click Apply.
Add duration
You can add a duration of time to column values. The duration can be a fixed value, or from another column.
-
Select Add duration in Function name.
-
Select which date column to add duration to in Column to process.
-
Select which date or time part to add in Date or time part.
-
Select if you want to set a fixed value, or a column value in Duration. The duration added will be according to what you selected in Date or time part.
-
If you selected Value, enter the duration in Duration value.
-
If you selected Column, select which column to use in Duration column.
-
-
Select Create new column if you want to store the results in a new column. Otherwise the results are stored in the same column.
Enter the name of the new column in New column name.
-
Click Apply.
Calculate date difference
You can calculate the difference between the date in a column and either now. a specific date, or a date in another column. The result is stored in a new column.
-
Select Calculate date difference in Function name.
-
Select which date column to add duration to in Column to process.
-
Optionally, you can select which unit to calculate the difference in Date or time part.
-
Select if you want to compare with now. a specific date, or a date in another column in Until.
-
If you selected Specific date, enter the date in This date. The input format is: yyyy-MM-DD HH:mm
-
If you selected Column, select which column to use in Column.
-
-
Enter the name of the new column in New column name.
-
Click Apply.
Extract date parts
You can extract parts of a date, time or datetime, and store the parts in individual columns.
-
Select Extract date parts in Function name.
-
Select which date column to extract date parts from in Column to process.
-
Select which parts to extract.
-
Enter a column prefix in New columns prefix. The columns that are created will be named starting with the prefix, followed by the part, separated with underscore.
-
Click Apply.