Daylight Savings Time
Eric Chatonet
eric.chatonet at sosmartsoftware.com
Tue Oct 28 08:50:07 EDT 2008
Bonjour Colin,
Le 28 oct. 08 à 13:15, Colin Holgate a écrit :
> convert the date to seconds
> put it into d1
> convert "6/6/06" to seconds
> put it into d2
> put (d1-d2) mod 86400 = 0
This works well for me:
function DaylightSavingsTimeIsActive
local tCurDate,tRefDate
-----
put the short date into tCurDate
convert tCurDate from short date to dateItems
put tCurDate into tRefDate
repeat with i = 2 to 3
put 1 into item i of tRefDate
-- January first
end repeat
convert tRefDate from dateItems to dateItems
-- updates last item of dateItems value
convert tCurDate from dateItems to seconds
convert tRefDate from dateItems to seconds
return (tRefDate - tCurDate) mod 86400 = 0
end DaylightSavingsTimeIsActive
Note that I always prefer to convert from a format to another format:
This ensures the process :-)
Best regards from Paris,
Eric Chatonet.
----------------------------------------------------------------
Plugins and tutorials for Revolution: http://www.sosmartsoftware.com/
Email: eric.chatonet at sosmartsoftware.com/
----------------------------------------------------------------
More information about the use-livecode
mailing list