weekday
Retrieves the weekday number from the date. If you need the weekday name, the use following function instead:
str( date[], "Tttt" );, possible with a 3rd parameter specifying the language.
Indirect parameter passing is disabled
1-2
No. | Type | Description |
---|---|---|
1 input |
date or string converted to date | Date Value to check. |
1 input |
numeral | Weekday calculation variant 1: 1 = Sunday, 2 = Monday .. 7 = Saturday |
Type | Description |
---|---|
numeral | Weekday number -1 is returned if no recognizable date is provided. |
for all parameters( { date(today) .. date(today)+10, date("15:00:00") }, date[] )
{
echo( str( date[], "Ttt, DD.Mmm.YYYY: " ), weekday(date[], 1), " ",
weekday(date[], 2), " ", weekday(date[], 3) );
}
Sun, 14.Jul.2024: 1 7 6
Mon, 15.Jul.2024: 2 1 0
Tue, 16.Jul.2024: 3 2 1
Wed, 17.Jul.2024: 4 3 2
Thu, 18.Jul.2024: 5 4 3
Fri, 19.Jul.2024: 6 5 4
Sat, 20.Jul.2024: 7 6 5
Sun, 21.Jul.2024: 1 7 6
Mon, 22.Jul.2024: 2 1 0
Tue, 23.Jul.2024: 3 2 1
Wed, 24.Jul.2024: 4 3 2
___, __.___.____: -1 -1 -1