SQL Notebook (logo)

DATENAME Function

Returns a human-readable text string representing the specified part of a date. Month and day names (like "January" and "Monday") are returned according to the local computer's culture settings. Time zone offsets are returned formatted like "+02:30" or "-06:00". Other date parts are returned as numbers that have been converted to strings.

Syntax

DATENAME(date-part, date)

Arguments

Return Value

A string containing the part of date that is specified by date-part.

Examples