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


 
OPTION EXPLICIT
 
' Months
DATA "January", "February", "March", "April", "May", "June", "July"
DATA "August", "September", "October", "November", "December"
 
' Days of week
DATA "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"
 
' Var
DIM dDate AS DOUBLE, sMonth(1 TO 12) AS STRING, sDay(1 TO 7) AS STRING
DIM i AS INTEGER
 
' Read Names of months
FOR i = 1 TO 12
  READ sMonth(i)
NEXT i
 
' Read Names of days
FOR i = 1 TO 7
  READ sDay(i)
NEXT i
 
' Assign current date to a variable
dDate = NOW
 
CLS
PRINT "Rosettacode: Display the current date formatted."
PRINT
PRINT "Today's date: "; FORMAT$(dDate, "ddddd")
PRINT
PRINT "Use of values in the lists."
PRINT "Today is "; sDay(WEEKDAY(dDate)); ", "; sMonth(MONTH(dDate)); " "; FORMAT$(DAY(dDate)); ", "; FORMAT$(YEAR(dDate)); "."
PRINT
PRINT "Use of just the FORMAT$() function."
PRINT "Today is "; FORMAT$(dDate, "dddd, mmmm d, yyyy"); "."
 
END
 