Extract date part¶
This task allows you to extract parts of date from a date column.
Let us start with the following data.
Let us assume we would like to know which day of the week these people were born in. We want to get the weekdays out of this.
Expected output data will look like this.
We can achieve that by doing the following:
- Open Data Preparation menu and click on Date Function
- Select Extract Date Part
- Choose the column Date
- Choose the option Weekday in the selection for What to extract
- Enter the name Weekday in the result column section
- Hit APPLY
The following options are supported by this task.
- Extract date from: The column to extract date from.
- What to Extract: The component of the date to extract.
- Apply result into: This option allows configuration of the destination of the results by this task. See result documentation.
|Component||Extracted Data type||Description||Example|
|Year||Numeric||The year part of date||2015|
|Month||Numeric||Month as a number between 1-12||7|
|Month Name||Text||English name of the Month||January|
|Month & Year||Text||Month as Text and Year||August, 2012|
|Date Part without time||Text||Date Part ignoring time||1989-07-12|
|Time Part without Date||Text||Just the Time part of the date||00:00:00|
|Quarter||Numeric||Quarter of the year||3|
|Weekday||Text||English day of week||Monday|
|Day of Year||Numeric||The day of the year as a number between 1-366||234|
|Day||Numeric||The day of the month||12|
|Hour||Numeric||Hour of day between 0 & 23||11|
|Minute||Numeric||Minute of the hour between 0 & 59||23|
|Second||Numeric||Second of the minute between 0 & 59||46|