Function DayOfWeek(year As Integer,month As Integer,day As Integer) As Integer ' sun mon tue wed thu fri sat ' 0 1 2 3 4 5 6 local integer a,m,y a = int((14-month)/12) m = month + 12*a - 2 y = year - a DayOfWeek = (day + y + int(y/4)-int(y/100)+int(y/400)+int(31*m/12)) mod 7 End Function