dayName Function

Top  Previous  Next

Gets a weekday name string.


DateTime.dayName(weekday [, numchar])


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.


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