Number of days between 2 dates
m.schonewille at economy-x-talk.com
Wed Apr 16 18:45:48 CEST 2014
This subject has been discussed very frequently. You may want to search
the archives for a solution.
Probably, all will work fine if you take 12:00 instead of 00:00. DST may
be the culprit.
Economy-x-Talk Consulting and Software Engineering
Installer Maker for LiveCode:
Buy my new book "Programming LiveCode for the Real Beginner"
LiveCode on Facebook:
On 4/16/2014 18:25, jbv at souslelogo.com wrote:
> 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 ?
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode