Number of days between 2 dates

jbv at jbv at
Wed Apr 16 12:25:57 EDT 2014

Hi list,

I need to calculate the number of days between any date and
january 1st of the same year.
So I tried this :
   put "1/31/14" && "0:00 AM" into tdate
   convert tdate to long seconds
   put "1/1/14" && "0:00 AM" into date0
   convert date0 to long seconds
   put (tdate - date0)/86400

which seems to work and returns an integer.
When I try this as 1st line of my script :
   put "3/30/14" && "0:00 AM" into tdate
it still works (returns 88).

And suddenly, the following :
   put "3/31/14" && "0:00 AM" into tdate
returns 88.958333

Any idea ?


More information about the Use-livecode mailing list