problems with date calculations

LiveCode is the premier environment for creating multi-platform solutions for all major operating systems - Windows, Mac OS X, Linux, the Web, Server environments and Mobile platforms. Brand new to LiveCode? Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

problems with date calculations

Post by Glenn Boyce » Tue Oct 21, 2008 11:01 pm

the other day I got some assistance to subtract some dates. I've changed the date format in my table now from dd/mm/yyyy to dd/mm/yy because its neater and the script won't work because its not the system date. I've looked at reference material and can't find a definition for the dd/mm/yy script I've been using is:

Code: Select all

repeat with n = 1 to the number of lines in gOrders
  
  put item  6 of line n of gOrders into tdate1         -- calculates lateness. Need to do this first so that only those that are late are displayed
put the system date into tdate2
convert tdate1 from system date to seconds
convert tdate2 from system date to seconds
put tdate1 - tdate2 into tdifference
divide tdifference by 60 * 60 * 24
if tdifference >= 0 then exit repeat

Glenn Boyce
Posts: 137
Joined: Thu Jul 24, 2008 11:22 pm

ignore

Post by Glenn Boyce » Tue Oct 21, 2008 11:09 pm

please disregard this posting. I've got it working. Different problem all together!!

Post Reply