func wkday year month day .
   adj = (14 - month) div 12
   mm = month + 12 * adj - 2
   yy = year - adj
   r = day + (13 * mm - 1) div 5 + yy + yy div 4 - yy div 100 + yy div 400
   return r mod 7 + 1
.
month$[] = [ "January" "February" "March" "April" "May" "June" "July" "August" "September" "October" "November" "December" ]
wday$[] = [ "Sunday" "Monday" "Tuesday" "Wednesday" "Thursday" "Friday" "Saturday" ]
# 
s$ = timestr systime
y$ = substr s$ 1 4
y = number y$
m$ = substr s$ 6 2
m = number m$
d$ = substr s$ 9 2
d = number d$
# 
print y$ & "-" & m$ & "-" & d$
print wday$[wkday y m d] & ", " & month$[m] & " " & d & ", " & y
