Cicode Programming Reference > Cicode Function Categories > Time and Date Functions Introduction > DateWeekDay

DateWeekDay

Gets the day of the week from a time/date variable.

Time/date functions can only be used with dates from 1980 to 2035. You should check that the date you are using is valid with Cicode similar to the following:

IF StrToDate(Arg1)>0 THEN
...
ELSE
...
END

Syntax

DateWeekDay(Time)

Time:

The time/date variable.

Return Value

An integer representing the day of the week as follows:

1 - Sunday

2 - Monday

3 - Tuesday

4 - Wednesday

5 - Thursday

6 - Friday

7 - Saturday

Related Functions

Date, TimeCurrent

Example

! If the current system date is Sunday, 3rd November 1991;
Variable=DateWeekDay(TimeCurrent());
! Sets Variable to 1.

See Also

Time/Date Functions