DatePart

The DatePart() function retrieves a part from a date. For example, the year, the month, the week, the day, the hour, the minutes or the seconds.

This function is NOT SQL compatible. For more information about SQL compatibility, see our documentation.

Syntax

DatePart(date, unit)

DatePart('2016-05-02T05:37:44', year) =>Result: 2016

DatePart() =>Result: unknown

Parameters

Name
Type
Required
Description

date

date time

☑️

a date

unit

keyword

☑️

Date unit keyword

Possible values: year, month, week, day, hour, minute or second.

Last updated

Was this helpful?