SQL Notebook (logo)

DATEPART Function

Returns an integer representing the specified part of a date. Weekdays are numbered as: Monday = 1, Tuesday = 2, ..., Saturday = 6, Sunday = 7. Time zone offsets are represented as a positive or negative number of minutes (for instance, an offset of "-04:00" is represented as -240).

Syntax

DATEPART(date-part, date)

Arguments

Return Value

An integer representing the part of date that is specified by date-part.

Examples