8.4.6 Weekday (return the weekday for a specified date)
- Purpose
-
Returns a one-digit number in the range 1 (Sunday) to 7 (Saturday), representing the day of the week for a specified date.
- Syntax
Weekday ([Date] [, Option])
- Arguments
-
- Date
-
Write the date in yyyy/mm/dd format. Numbers specified in the range 0 to 69 in yyyy are read as 2000 to 2069.
If an invalid value is specified for mm, an error occurs. However, if an invalid value is specified for dd, no error occurs. Instead, the Weekday command replaces the specified date with the equivalent valid date and returns the result. For example, if 1999/12/33 (a nonexistent date) were specified, the Weekday command would replace the specified date with the valid date 2000/01/02 and would return 1 (for Sunday).
This value is optional. If you omit this value, the current date is assumed.
- Option
-
Specify one of the following values:
Value
Meaning
String
Return an abbreviation as the day of the week.
StringJ
Return the full name as the day of the week.
- Description
-
If you omit the Option argument, the Weekday command returns a single-digit number in the range 1 (Sunday) to 7 (Saturday), as follows:
Value
Meaning
1
Sunday
2
Monday
3
Tuesday
4
Wednesday
5
Thursday
6
Friday
7
Saturday
If you specify the Option argument, the return value is one of the following strings:
String specified in Option
StringJ specified in Option
"SUN"
"Sunday"
"MON"
"Monday"
"TUE"
"Tuesday"
"WED"
"Wednesday"
"THU"
"Thursday"
"FRI"
"Friday"
"SAT"
"Saturday"
- JP1/Script version
-
Supported from JP1/Script 01-00.