WEEKDAY
 
Syntax


#include <RTC.bas>                  ' source in /Program Files/Coridium/BASIClib

#include <RTC17.bas>             ' for the PROplus and SuperPRO LPC175x

FUNCTION WEEKDAY(value)     'When called with -1 the current value for WEEKDAY is returned.

Description


Function setting or returning the day of the week.

When called with zero or greater value, the WEEKDAY is changed.
0 corresponding to Sunday through 6 corresponding to Saturday

Example

#include <RTC.bas>
...
DIM dayname(15) as string
...
SECOND (30)
MINUTE (15)
HOUR (13)
DAY (14)
MONTH (4)
YEAR (2006)

SELECT WEEKDAY(-1)
CASE 0
   dayname = "Sunday"
CASE 1
   dayname = "Monday"
CASE 2
   dayname = "Tuesday"
CASE 3
   dayname = "Wednesday"
CASE 4
   dayname = "Thursday"
CASE 5
   dayname = "Friday"
CASE 6
   dayname = "Saturday"
CASE ELSE
   dayname = "not possible"
ENDSELECT

PRINT "This is "; dayname,  MONTH(0); "/"; DAY(0); "/"; YEAR(0), "at"; HOUR(-1); ":"; MINUTE(-1); ":"; SECOND(-1)
The output would look like:
This is Friday 4/14/2006 at 13:15:30