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

[MacPerl] MacPerl & Netscape history files...



I've run into an odd problem while playing with my own version of Tom
Christiansen's "ggh" script.  While it works fine on my Unix host, the
dates it produces when run on my Mac are, to put it mildly, odd.

I'm not sure whether it's a variation in Netscape, in MacPerl, or
something else.

(1) I'm using Netscape 4.04 on both platforms.  Under Unix perl, I can
unpack the date using network byte order:

     unpack('N',$date)

However, on the Mac I have to use 'V' ("vax" style) to get anything that
approaches useful.

(2) Once I've got the date on the Mac, I need to apply an adjustment
factor to it.  I'm currently using:

  $date_adjust	= ((1970 - 1904) * ONE_YEAR) + (16 * ONE_DAY) + (19 *
ONE_HOUR);

The first part doesn't surprise me, given the differences in epoch dates
on Mac vs. Unix systems.  But why the 16 days 19 hours?  This gives me
reliable dates, but it's one of the ugliest adjustments I've ever seen.

If someone out there can shed some light on this I'd appreciate it.

Thanks,

-- Lars

--
Lars Kellogg-Stedman * lars@bu.edu * (617)353-8277
Office of Information Technology, Boston University


***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch