FUNCTION dow$(d$ AS STRING) AS STRING
DIM a AS INTEGER
DIM y AS INTEGER
DIM m AS INTEGER
DIM DOW AS INTEGER
DIM dd$ AS STRING
dd$="SunMonTueWedThuFriSat"
a = (14 - VAL(MID$(d$,1,2))) / 12 : y = VAL(MID$(d$,7,4)) - a
m = VAL(MID$(d$,1,2)) + 12 * (a - 2)
dow = (VAL(MID$(d$,4,2)) + y + y/4 - y/100 + y/400 + (31 * m)/12) MOD 7
dow$=MID$(dd$,(dow*3)+1,3)
END FUNCTION
FUNCTION dow(d$ AS STRING) AS INTEGER
DIM a AS INTEGER
DIM y AS INTEGER
DIM m AS INTEGER
DIM dd AS INTEGER
a = (14 - VAL(MID$(d$,1,2))) / 12 : y = VAL(MID$(d$,7,4)) - a
m = VAL(MID$(d$,1,2)) + 12 * (a - 2)
dow = (VAL(MID$(d$,4,2)) + y + y/4 - y/100 + y/400 + (31 * m)/12) MOD 7
END FUNCTION
D$ = dow$(DATE$)
D% = dow(DATE$)
SHOWMESSAGE d$+" - "+STR$(d%)
|