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) );
}
Sat, 19.Oct.2024: 7 6 5
Sun, 20.Oct.2024: 1 7 6
Mon, 21.Oct.2024: 2 1 0
Tue, 22.Oct.2024: 3 2 1
Wed, 23.Oct.2024: 4 3 2
Thu, 24.Oct.2024: 5 4 3
Fri, 25.Oct.2024: 6 5 4
Sat, 26.Oct.2024: 7 6 5
Sun, 27.Oct.2024: 1 7 6
Mon, 28.Oct.2024: 2 1 0
Tue, 29.Oct.2024: 3 2 1
___, __.___.____: -1 -1 -1