#-h- date.r 1146 asc 28-apr-81 10:49:40 [002,100] #-h- main 1084 asc 28-apr-81 10:48:12 [002,100] # print day-of-week, and current date and time DRIVER(date) integer now(7), day, form integer wkday, getarg, equal character date(10), time(9) string sunday "Sunday" string monday "Monday" string tuesda "Tuesday" string wednes "Wednesday" string thursd "Thursday" string friday "Friday" string saturd "Saturday" string twoblk " " string minusn "-n" call query("usage: date [-n].") form = LETTER if (getarg(1, date, 10) != EOF) { call fold(date) if (equal(date, minusn) == YES) form = DIGIT } call getnow(now) call fmtdat(date, time, now, form) day = wkday(now(2), now(3), now(1)) if (day == 1) call putlin(sunday, STDOUT) else if (day == 2) call putlin(monday, STDOUT) else if (day == 3) call putlin(tuesda, STDOUT) else if (day == 4) call putlin(wednes, STDOUT) else if (day == 5) call putlin(thursd, STDOUT) else if (day == 6) call putlin(friday, STDOUT) else if (day == 7) call putlin(saturd, STDOUT) call putlin(twoblk, STDOUT) call putlin(date, STDOUT) call putlin(twoblk, STDOUT) call putlin(time, STDOUT) call putch(NEWLINE, STDOUT) DRETURN end #-h- date.rof 593 asc 03-may-81 01:03:44 [002,100] .pl 60 .bp .rm 70 .in 0 .he 'DATE'1/11/79'DATE' .fo ''-#-' .fi NAME .br .in 7 date - print the date .sp 1 .in SYNOPSIS .br .in 7 date [-n] .sp 1 .in DESCRIPTION .br .in 7 The current date and time are printed in the format: .ti +20 dd-mmm-yy hh:mm:ss .sp 1 if the -n switch is used the date is output in the following format: .ti +20 mm/dd/yy hh:mm:ss .sp 1 .in FILES .br .in 7 None .sp 1 .in SEE ALSO .br .in 7 The Unix command 'date' .sp 1 .in DIAGNOSTICS .br .in 7 None .sp 1 .in AUTHORS .br .in 7 .sp 1 Debbie Scherrer .sp 1 .in BUGS .br .in 7