This task has been clarified. Its programming examples are in need of review to ensure that they still fit the requirements of the task.


Task

Display the   current date   in the formats of:

   2007-11-23     and 
   Friday, November 23, 2007


DEFINE PTR="CARD"
 
TYPE Date=[
  INT year
  BYTE month
  BYTE day]
 
PTR ARRAY DayOfWeeks(7)
PTR ARRAY Months(12)
 
PROC Init()
  DayOfWeeks(0)="Sunday"   DayOfWeeks(1)="Monday"
  DayOfWeeks(2)="Tuesday"  DayOfWeeks(3)="Wednesday"
  DayOfWeeks(4)="Thursday" DayOfWeeks(5)="Friday"
  DayOfWeeks(6)="Saturday"
  Months(0)="January"   Months(1)="February"
  Months(2)="March"     Months(3)="April"
  Months(4)="May"       Months(5)="June"
  Months(6)="July"      Months(7)="August"
  Months(8)="September" Months(9)="October"
  Months(10)="November" Months(11)="December"
RETURN
 
;https://en.wikipedia.org/wiki/Determination_of_the_day_of_the_week#Sakamoto.27s_methods
BYTE FUNC DayOfWeek(Date POINTER d)	;1<=m<=12, y>1752
  BYTE ARRAY t=[0 3 2 5 0 3 5 1 4 6 2 4]
  BYTE res
  INT y
 
  y=d.year
  IF d.month<3 THEN
    y==-1
  FI
  res=(y+y/4-y/100+y/400+t(d.month-1)+d.day) MOD 7
RETURN (res)
 
PROC PrintB2(BYTE x)
  IF x<10 THEN
    Put('0)
  FI
  PrintB(x)
RETURN
 
PROC PrintDateShort(Date POINTER d)
  PrintI(d.year) Put('-)
  PrintB2(d.month) Put('-)
  PrintB2(d.day)
RETURN
 
PROC PrintDateLong(Date POINTER d)
  BYTE wd
 
  wd=DayOfWeek(d)
  Print(DayOfWeeks(wd)) Print(", ")
  Print(Months(d.month-1)) Put(' )
  PrintB(d.day) Print(", ")
  PrintI(d.year)
RETURN
 
PROC Main()
  Date d
 
  Init()
 
  ;There is no function to get the current date
  ;on Atari 8-bit computer
  d.year=2021 d.month=9 d.day=1
 
  PrintDateShort(d) PutE()
  PrintDateLong(d) PutE()
RETURN