Using seconds in Revolution

SimPLsol at aol.com SimPLsol at aol.com
Wed Apr 14 16:43:43 EDT 2004


Dar,
     Thank you for elaborating.
     Perhaps a little more detail on my part will help.
     I have a business system that I sell all over the US, Canada, and other 
countries. I am trying to find a consistent way of handling dates that will 
not have to be "hard wired" for each area.
     As an example, users want to see if there is enough inventory to cover 
shipments for the next week. I have the computer look at purchases arriving by 
day through the week and sales to be delivered by day through the week. One 
has to look at the info by day because it does no good to know that 100 are 
coming in and only 80 are going out this week if the 80 are scheduled to go out 
three days before the 100 come in.
     In HyperCard I convert all of the incoming and outgoing dates to 
seconds, then convert the start date for the week to seconds, and do 6 repeat loops 
(one for each day) to check for activity on that day, at the end of each loop I 
add 86400 to the seconds to check the next day.      This has worked fine for 
over a decade in HC (it is very fast) and I use it many places. It now breaks 
in OS X in Revolution where there are days with 82800 seconds and days with 
90000 seconds. It is not practical to try anticipating how many seconds there 
will be in each day in all of the places where this system is used (for 
instance daylight savings time starts different days in different places - and is not 
used at all elsewhere - New Zealand goes on to DST when the US comes off).
     As far as I can tell there is no way of dealing with seconds now that 
works the old way. That is, a system of seconds that starts at "0" on Jan. 1, 
1970 (or any other date) and increases by 86400 per day.
     I agree this could be handled by a new function (call it the 
simpleSeconds) if necessary. But I figured I'm not the first or last person to run into th
is problem and
1. a solution probably already exists or
2. this simpleSeconds option should be added to Rev. for the benefit of all.
     I appreciate your insight.
Paul Looney
PS I do not use sub-seconds, and socket timing is not an issue. I'm just 
trying to increment a timing loop by one day (and seconds work somewhat better 
than dateItems - if there are an equal number of seconds per day).


More information about the use-livecode mailing list