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

Re: [MacPerl] Y2K complience



garye@iname.com writes:
}[snip]
}> The
}> only MacPerl specific thing that occurs in the time routines is that the
}> Mac zero of time is 1904, so when you use Time::Local and you mean 2006,
}> you have to give a year of 106.  (On a Unix box, there are unique 2 digit
}> years for its entire span of years, since the range there is 1970 - 2038,
}> and you can use them in Time::Local).
}>
}[snip]
}
}Are you talking about the timegm() and the time() functions that return
}and convert seconds since the the epoch?  This has nothing to do with it
}2 digit years!!!!

You should really get your ! key fixed.

No, I'm talking about the fact that *on Unix*, you can abbreviate all the
years in it's range (from zero of time in 1970 to the end of time in 2038)
by two digits.  In other words, if you feed time a year 1, it realizes that
you're talking about 2001.  (This is something that can be learned by
reading the source, an exercise I'd recommend heartily in this case.  Do it
on a Mac, and you'll see what Matthias had to do to Time::Local to deal
with the different zero of time).

}
}You can give it negative numbers to get before Jan 1, 1970 (I have a
}script that convert seconds since the epoch to a regular date b/c I need
}to do this often). I just verified that it does work!!!!!!
}
}I think that you are implying that on a unix box if you want the year
}1970 you give localtime the year 00 -- this is very very wrong.  On the
}unix box you give it the year you want in the form (year you want -
}1900).  I am not sure what your point is about Unix boxes but I am
}pretty sure it is wrong!!! or at least very vague.

No, you give localtime the year 70, and it does the rest.  (Or you can give
it 1970, and it does it's thing.  Just don't give it 1870.)

}
}Also I find it hard to believe that the epoch on a Mac is January 1,
}1904.  I am not a mac expert (I work mainly on unix boxes) but I find it
}hard to believe that _all_ macs can store a number that large!  Just to
}get to the year 2000 we would be talking about 96 years (that is
}2,936,217,600 seconds).  That would fit into a 32 bit binary number with
}about 43 years to spare.  But I do not believe that the 68k macs are 32
}bit machines.  Maybe the epoch is Jan 1, 1904 on PowerPC's but not on
}68k mac's but I very much doubt it.  That would make for very very
}unportable code!!!!

There's an old saying, which I paraphrase: "Nature doesn't care about what
you believe".  Neither does the MacOS.  It's been this way from the
beginning.  In fact, nowadays I believe it uses a 64 bit int internally for
the seconds from the epoch.


}
}
}Maybe there is someone out there that can clarify this!!!!!

Hope this helps.

}
}
}	Gary
}--
}Gary Ebert                                 Operations Administrator
}Voice:     (301) 428-2115                  Mobile Datacom Corporation
}Fax:       (301) 428-1004                  19540 Amaranth Drive
}Pager:     (800) 490-7478                  Germantown, MD  20875-2126


---
Paul J. Schinder
NASA Goddard Space Flight Center
Code 693, Greenbelt, MD 20771
schinder@pjstoaster.pg.md.us



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