Counting days from a past date

dfepstein at comcast.net dfepstein at comcast.net
Tue May 8 16:32:19 EDT 2012




I want to count the number of days between some past date and today. 

I tried this (using Rev 3.0): 

  

on mouseUp 

  put "March 12, 2012" into a 

  convert a to seconds -- LC should understand this as midnight 

  get the date 

  convert it to seconds -- should also be midnight 

  put (it - a)/(24*3600) -- elapsed seconds divided by seconds per day 

end mouseUp 

  

This yields "57", which seems right. 

  

But if I change the first line to 

  

  put "March 11, 2012" into a 

  

the result is not an integer: 

57.958333 

  

Why would that be? 

  

David Epstein 



More information about the Use-livecode mailing list