|
Post by David Drake on Mar 2, 2020 7:22:40 GMT -5
The code below is for the Rosetta Code task "days between dates" found here: rosettacode.org/wiki/Days_between_dates. This is a draft programming task. Task reads: "Calculate the number of days between two dates. Date input should be of the form YYYY-MM-DD." As always, comments and corrections are welcome. 'Calculate the number of days between two dates. Date input should be of the form YYYY-MM-DD.
input "Input date 1 (YYYY-MM-DD): ";date1$ input "Input date 2 (YYYY-MM-DD): ";date2$ date1$ = right$(date1$,4)+"-"+left$(date1$,5)'must reformat for date$() command to work date2$ = right$(date2$,4)+"-"+left$(date2$,5) days1 = date$(date1$) days2 = date$(date2$) print "Number of days between dates: ";days2-days1 end
|
|