DATEPART Function

Returns the date as year, month, and day.

Category: Date and Time
Returned data type: DATE

Syntax

DATEPART(ts)

Arguments

ts

specifies the timestamp.

Example

The following statement illustrates the DATEPART function:
Statements
Results
select datepart(timestamp '2013-09-24 14:46:58');
24SEP2013
select put(datepart(d), date9.) from myoracle.test;
24SEP2013
select put(datepart(t), time12.) from myoracle.test;
5:26:42
Last updated: February 23, 2017