3.5.1.2.15 WeekDay

Description

This function is used to return the day of the week given a Julian Date. By default, day values are from 0 (Sunday) to 6 (Saturday).


See this note.

Syntax

 int WeekDay(double d[, int n])

Parameters

d

is a Julian Date Value which can include Time

n

is a integer value, there are three options
0 (default) Returns 0 (Sunday) through 6 (Saturday) [Same as Origin DayOfWeek]
1 Returns 1 (Sunday) through 7 (Saturday)
2 Returns 0 (Monday) through 6 (Sunday)
3 Returns 1 (Monday) through 7 (Sunday)

Return

If it is a Julian days date, return the the day of the week, 0 to 6 or 1 to 7 according your setting of n.

If it is not a Julian days date, return -1.

Example

int rr=weekday(2454825);
rr= ; // Should return the day of the week, 4.
int rr=weekday(2454825, 1);
rr= ; // Should return the day of the week, 5.

See Also

WeekNum, Year, Month, Day, Hour, Minute, Second, Now,