datename

Extracts "datepart" of "datetime_expression" and returns its value as a character string. "Datepart" refers to a year, month, day, hour, minute, or second. "Datetime_expression" can be a date, a time, or a timestamp.

Syntax

datename ( { datepart } , datetime_expression )