Clovertech
› Clovertech Forums › Read Only Archives › Cloverleaf › Cloverleaf › Subtracting Days
How do I take a date (not the current date) and subtract it from another date to see how many days have elapsed.
I cannot use the “20061101 – 20061031” format because in this case it would give me 70 days due to the month change.
There may be an easier way, but this will work:
set today [clock scan “20061128”]
set lastWeek [clock scan “20061121”]
set elapsedSecs [expr $today – $lastWeek]
set numDays [expr $elapsedSecs / 86400]
Steve
Thanks a lot Steve.
Randy Colella
Massachusetts Eye & Ear Infirmary
Boston, MA