Date bug?

Richard Gaskin ambassador at fourthworld.com
Sun Jan 2 00:50:31 EST 2011


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

Confirmed here.

Oddly enough, it works well if instead of converting to seconds you 
convert to dateItems, and add 1 to item 3 of that value.

--
  Richard Gaskin
  Fourth World
  LiveCode training and consulting: http://www.fourthworld.com
  Webzine for LiveCode developers: http://www.LiveCodeJournal.com
  LiveCode Journal blog: http://LiveCodejournal.com/blog.irv




More information about the Use-livecode mailing list