Date format: Difference between revisions
Content added Content deleted
Line 235: | Line 235: | ||
PRINT Format(today, "yyyy-mm-dd") |
PRINT Format(today, "yyyy-mm-dd") |
||
PRINT Format(today, "dddd, mmmm d, yyyy")</lang> |
PRINT Format(today, "dddd, mmmm d, yyyy")</lang> |
||
=={{header|VB-DOS|PDS 7.1 BASIC}}== |
|||
{{works with|Visual Basic for DOS and PDS 7.1}} |
|||
<lang vb> |
|||
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 |
|||
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"); ", "; FORMAT$(dDate, "mmmm"); " "; FORMAT$(dDate, "d"); ", "; FORMAT$(dDate, "yyyy"); "." |
|||
END |
|||
</lang> |
|||
=={{header|Batch File}}== |
=={{header|Batch File}}== |