Beyond POSIX time

Richard Gaskin ambassador at fourthworld.com
Sat Jan 9 09:44:09 EST 2016


dunbarx wrote:

 > On 1/8/2016 4:53 PM, Richard Gaskin wrote:
 >> Try this:
 >>
 >> on mouseUp
 >>    put "1/1/69" into t
 >>    convert t to secs
 >>    convert t to short date
 >>    put t
 >> end mouseUp
 >
 > I get the date you first put in. Tried several, all the way back
 > to the battle of Hastings. All good The negative seconds do the
 > math as well as ordinary ones.

I'm guessing that, like Jacque, you ran that on OS X, where apparently 
the OS provides extended handling of date ranges beyond what Windows and 
Linux provide without additional libraries.

As Mark Waddingham noted in the report he filed on this:

    (Note that at present, the 1970 thru 3000 range is guaranteed
    to work cross-platform, a wider range of dates works on OS X
    but isn't strictly supported).
<http://quality.livecode.com/show_bug.cgi?id=4941>

I don't use Windows often beyond testing and touch-up, but since it's 
still the most important platform in the world for developer revenue I 
recognize that whether or not I use it is less important than that my 
customers use it; i.e., Windows pays my bills.

I happen to use Linux for most of my development, and while for 
client-side apps the number of customer I support for Linux is small, as 
I move more and more code to servers these sorts of things potentially 
affect all customers, regardless what OS they're running on the client-side.

I'm okay with continuing to use libraries for this.  I have some Julian 
routines I threw together about 15 years ago, and Malte's library is no 
doubt an even better solution.

I was just reminded of this when I came across this forum post yesterday 
from Sparkout:

    Calendar pickers still need to be coded around for dates prior
    to 1970 on Windows. And don't say this is a "bug" on Windows.
    It can be coded around in script, why can't the coding around
    be done in the engine?
<http://forums.livecode.com/viewtopic.php?f=7&t=26236&p=136474#p136474>

I was double-checking things before I replied there, and had hoped that 
perhaps the enhancement to handle broader date ranges may have already 
found its way into the engine.

For those of us already hooked on LC it's a small matter to use Malte's 
lib and hook it into our work.  But for newcomers this may from time to 
time be one of those gotchas that will cause hair to be pulled as 
they're learning.

-- 
Richard Gaskin
Fourth World Systems
Software Design and Development for the Desktop, Mobile, and the Web
____________________________________________________________________
Ambassador at FourthWorld.com http://www.FourthWorld.com






More information about the use-livecode mailing list