Date bug?
Peter Brigham MD
pmbrig at gmail.com
Sun Jan 2 08:34:34 EST 2011
On Jan 1, 2011, at 11:58 PM, Chipp Walters wrote:
> Hey, can anyone try this or tell me why it doesn't work?
> If I use any other date than 11/07/2010, it generates the next date.
> But for
> some reason Nov 7 doesn't work?
>
> on mouseUp
> put "11/07/2010" into tDate
> answer nextDayDate(tDate)
> end mouseUp
>
> function nextDayDate pDate
> convert pDate to seconds
>
> put 60*60*24 into tSecondsInDay
> add tSecondsInDay to pDate
> convert pDate to short date
> return pDate
> end nextDayDate
I think it is related to the daylight savings shift, that's why it
works if you add an hour. Here's what I use, to avoid all problems:
function nextDayDate pDate
convert pDate to dateitems
add 1 to item 2 of pDate
convert pDate to short date
return pDate
end nextDayDate
-- Peter
Peter M. Brigham
pmbrig at gmail.com
http://home.comcast.net/~pmbrig
More information about the use-livecode
mailing list