[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] mktime Broken?



On Wed, Apr 07, 1999 at 11:36:07PM -0700, A K Suska wrote:
} I thought I had seen a thread about difficulties using the POSIX time 
} functions--can someone refresh my memory about problems with mktime and
} workarounds (if any)?  No matter what I feed to mktime I get a negative value
} back that chokes ctime, localtime, etc showing only Jan 1, 1904.

Whenever dealing with times using MacPerl, it's always a good idea to
remember that current Mac times are already > 2^31 seconds past Jan 1,
1904.  So you have to keep Perl from interpreting this as a signed
integer, or you're hosed.  One useful trick is to assign or pass
$time | 0.  This won't change the value at all, but seems to force Perl
to interpret the value as an unsigned integer, which is what you want.
Without seeing any code, I can't tell you any more than this.

} 
} TIA
} 
} Alex
} 

-- 
Paul Schinder
schinder@pobox.com



===== Want to unsubscribe from this list?
===== Send mail with body "unsubscribe" to macperl-request@macperl.org