Losing track of time

Robert Brenstein rjb at rz.uni-potsdam.de
Tue Aug 12 04:50:01 EDT 2003


>>The only complication is that one needs to account for midnight 
>>(end of the day), end of the month, and end of the year. May be 
>>there is a way to avoid this somehow.
>
>Actually, that's the beauty of dateitems -- you don't have to 
>account for any of that stuff. When you add a number to any item of 
>the dateItems and then convert that string back to any other 
>date/time format, the conversion handles all the spanning 
>calculations for you.
>
>For example, starting at 8 PM on January 1:
>
>   get "1/1/03 8:00 PM"
>   convert it to dateitems
>   add 6 to item 4 of it -- add six hours to the "hours" item
>   convert it to long date and time
>   put it
>
>In this case, adding 6 hours to the dateItems string causes it to 
>span midnight. The second conversion yields:
>
>   Thursday, January 2, 2003 2:00 AM
>
>It is one of the handiest things about the whole date/time "convert" process.
>
>--
>Jacqueline Landman Gay         |     jacque at hyperactivesw.com
>HyperActive Software           |     http://www.hyperactivesw.com
>

Wow, you never cease to amaze us, Jacqueline! Is this documented anywhere?

Robert



More information about the use-livecode mailing list