zee
New Member
Posts: 6
|
Post by zee on Sept 1, 2018 22:47:59 GMT
How to find and print the days of the week.
|
|
|
Post by Rod on Sept 2, 2018 10:53:22 GMT
Just one way to do it. Just BASIC knows what day of the week it was on 01/01/1901 and it knows how many days have elapsed since so MOD 7 cycles through to find todays week day name. Works for months as well.
'this works because val() will only value the string up to the first \ print "The month is ";word$("JAN FEB MAR APR MAY JUN JUL AUG SEP OCT NOV DEC",val(date$("MM/DD/YY")))
'this works because date$("days") returns the number of days since 1/1/01 mod 7 cycles to day of week print "Today is ";word$("TUE WED THU FRI SAT SUN MON",date$("days") mod 7+1)
|
|