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.
Vectorization: This function supports vectorization in the 1st function parameter.
Instead of providing a single value, you can provide a set or even a nested set which contain multiple values.
The function will then process every value and its return value contains a corresponding set containing all results.
Indirect parameter passing is disabled
Vectorization is allowed in the 1st function parameter
1-2
No. | Type | Description |
---|---|---|
1 input |
date or string converted to date set |
Date Value to extract as described above. Vectorization: Put multiple values into a (nested) set. |
1 input |
numeral | Weekday calculation variant 1: 1 = Sunday, 2 = Monday .. 7 = Saturday |
Type | Description |
---|---|
numeral set |
Weekday number Returned value as described above. -1 returned if no appropriate date found. If vectorization is applied, then the function returns a set containing mulitple values. |
for all( { 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, 01.Jun.2025: 1 7 6
Mon, 02.Jun.2025: 2 1 0
Tue, 03.Jun.2025: 3 2 1
Wed, 04.Jun.2025: 4 3 2
Thu, 05.Jun.2025: 5 4 3
Fri, 06.Jun.2025: 6 5 4
Sat, 07.Jun.2025: 7 6 5
Sun, 08.Jun.2025: 1 7 6
Mon, 09.Jun.2025: 2 1 0
Tue, 10.Jun.2025: 3 2 1
Wed, 11.Jun.2025: 4 3 2
___, __.___.____: -1 -1 -1