dayName Function

Top  Previous  Next

Gets a weekday name string.

Syntax

DateTime.dayName(weekday [, numchar])

Arguments

weekdayAn integer in the range 0 - 6 referring to a day of the week; 0 = Sunday.
numcharAn optional integer giving the maximum number of characters to return in the string.

Return Value

A string with the English name for the day of the week. If numchar is given, the string will be no more than numchar characters, allowing you to easily retrieve the name as an abbreviation.

Examples

DateTime.dayName(2)// returns "Tuesday"
DateTime.dayName(6,3)// returns "Sat"