Subtract two dates

Example scripts and tips (replaces Old Scripts & Tips archive)

Moderators: Dorian (MJT support), JRL, Phil Pendlebury

Post Reply
User avatar
Marcus Tettmar
Site Admin
Posts: 7380
Joined: Thu Sep 19, 2002 3:00 pm
Location: Dorset, UK
Contact:

Subtract two dates

Post by Marcus Tettmar » Sun Oct 04, 1998 11:00 pm

Contributed By: Blake Delaney [email protected]
Submitted On: 05/10/98

This script demonstrates how you can subtract two dates. In this example it calculates how many days it has been since 3/4/98. (Finds the difference between today's date and 3/4/98)

Remark>------SUBTRACT TWO DATES ----------
Let>date1=3/4/98

Let>diff=0
GetDate>today
Label>checksame
If>today=date1,founddiff
Sub>today,1
Add>diff,1
If>diff>2000,quit
Goto>checksame
Label>founddiff
MessageModal>It has been %diff% days since 03/04/98.
Goto>ending
Label>quit
MessageModal>Error: either the date on your computer is set earlier than
03/04/98, or it has been more than 2000 days since that date.
Label>ending

Post Reply
Sign up to our newsletter for free automation tips, tricks & discounts