Date Time Functions | DataFrame Column | Teradata Package for Python - Date Time Functions - Teradata Package for Python

Teradata® Package for Python User Guide

Deployment
VantageCloud
VantageCore
Edition
Enterprise
IntelliFlex
VMware
Product
Teradata Package for Python
Release Number
20.00
Published
December 2024
ft:locale
en-US
ft:lastEdition
2025-01-23
dita:mapPath
nvi1706202040305.ditamap
dita:ditavalPath
plt1683835213376.ditaval
dita:id
rkb1531260709148
Product Category
Teradata Vantage

teradataml DataFrameColumn supports following set of date time functions.

See the Data Time Functions section of Teradata Package for Python Function Reference, B700-4008) at https://docs.teradata.com/ for detailed description and usage examples of these functions.

Data Time Functions supported by DataFrameColumn
Sr. No. Function Name Description
1 week_start() Returns the first date or timestamp of the week that begins immediately before the specified date or timestamp value in a column as a literal.
2 week_begin() This is an alias for week_start() function.
3 week_end() Returns the last date or timestamp of the week that ends immediately after the specified date or timestamp value in a column as a literal.
4 month_start() Returns the first date or timestamp of the month that begins immediately before the specified date or timestamp value in a column or as a literal.
5 month_begin() This is an alias for month_start() function.
6 month_end() Returns the last date or timestamp of the month that ends immediately after the specified date or timestamp value in a column or as a literal.
7 year_start() Returns the first date or timestamp of the year that begins immediately before the specified date or timestamp value in a column or as a literal.
8 year_begin() This is an alias for year_start() function.
9 year_end() Returns the last date or timestamp of the year that ends immediately after the specified date or timestamp value in a column or as a literal.
10 quarter_start() Returns the first date or timestamp of the quarter that begins immediately before the specified date or timestamp value in a column as a literal.
11 quarter_begin() This is an alias for quarter_start() function.
12 quarter_end() Returns the last date or timestamp of the quarter that ends immediately after the specified date or timestamp value in a column as a literal.
13 last_sunday() Returns the date or timestamp of Sunday that falls immediately before the specified date or timestamp value in a column as a literal.
14 last_monday() Returns the date or timestamp of Monday that falls immediately before the specified date or timestamp value in a column as a literal.
15 last_tuesday() Returns the date or timestamp of Tuesday that falls immediately before the specified date or timestamp value in a column as a literal.
16 last_wednesday() Returns the date or timestamp of Wednesday that falls immediately before specified date or timestamp value in a column as a literal.
17 last_thursday() Returns the date or timestamp of Thursday that falls immediately before specified date or timestamp value in a column as a literal.
18 last_friday() Returns the date or timestamp of Friday that falls immediately before specified date or timestamp value in a column as a literal.
19 last_saturday() Returns the date or timestamp of Saturday that falls immediately before specified date or timestamp value in a column as a literal.
20 day_of_week() Returns the number of days from the beginning of the week to the specified date or timestamp value in a column as a literal.
21 day_of_month() Returns the number of days from the beginning of the month to the specified date or timestamp value in a column as a literal.
22 day_of_year() Returns the number of days from the beginning of the year to the specified date or timestamp value in a column as a literal.
23 day_of_calendar() Returns the number of days from the beginning of the business calendar to the specified date or timestamp value in a column as a literal.
24 week_of-month() Returns the number of weeks from the beginning of the month to the specified date or timestamp value in a column as a literal.
25 week_of_quarter() Returns the number of weeks from the beginning of the quarter to the specified date or timestamp value in a column as a literal.
26 week_of_year() Returns the number of weeks from the beginning of the year to the specified date or timestamp value in a column as a literal.
27 week_of_calendar() Returns the number of weeks from the beginning of the calendar to the specified date or timestamp value in a column as a literal.
28 month_of_year() Returns the number of months from the beginning of the year to the specified date or timestamp value in a column as a literal.
29 month_of_calendar() Returns the number of months from the beginning of the calendar to the specified date or timestamp value in a column as a literal.
30 month_of_quarter() Returns the number of months from the beginning of the quarter to the specified date or timestamp value in a column as a literal.
31 quarter_of_year() Returns the number of quarters from the beginning of the year to the specified date or timestamp value in a column as a literal.
32 quarter_of_calendar() Returns the number of quarters from the beginning of the calendar to the specified date or timestamp value in a column as a literal.
33 year_of_calendar() Returns the year of the specified date or timestamp value in a column as a literal.
34 day_occurence_of_month() Returns the nth occurrence of the weekday in the month for the date to the specified date or timestamp value in a column as a literal.
35 year() Returns the integer value for year in the specified date or timestamp value in a column as a literal.
36 month() Returns the integer value for month in the specified date or timestamp value in a column as a literal.
37 hour() Returns the integer value for hour in the specified timestamp value in a column as a literal.
38 minute() Returns the integer value for minute in the specified timestamp value in a column as a literal.
39 second() Returns the integer value for seconds in the specified timestamp value in a column as a literal.
40 week() Returns the number of weeks from the beginning of the year to the specified date or timestamp value in a column as a literal.
41 next_day() Returns the date of the first weekday specified as 'day_value' that is later than the specified date or timestamp value in a column as a literal.
42 months_between() Returns the number of months between value in specified date or timestamp value in a column as a literal and date or timestamp value in argument.
43 add_month() Adds an integer number of months to specified date or timestamp value in a column as a literal.
44 oadd_month() Adds an integer number of months, date or timestamp value in specified date or timestamp value in a column as a literal.
45 to_date() Function converts a string to Date.
46 to_timestamp() Converts string or integer value to a TIMESTAMP data type or TIMESTAMP WITH TIME ZONE data type.
47 extract() Extracts date component to a numeric value.
48 to_interval() Converts a numeric value or string value into an INTERVAL_DAY_TO_SECOND or INTERVAL_YEAR_TO_MONTH value.