datename

Returns the text name for part of a date, such as the name of a month or the weekday name.

Function

result = datename(part, input)

Arguments

ArgumentData Type
partdatepart
inputdate or time or datetime
resultstring

Comments

datepart is one of the following words without quotes: year, quarter, month, week, day of month, hour, minute, second

This function operates in the local time-zone if a datetime input is provided. See Dates, Times and Time Zones.

Examples

result = datename(month, getdate()) /* result = 'May' if the current month is May */
result = datename(weekday, #2019-07-06#) /* result = 'Friday' */