[Pythonmac-SIG] time screwed up

Peter Funk pf@artcom-gmbh.de
Thu, 20 Apr 2000 01:54:23 +0200 (MEST)


Hi!

Schollnick, Benjamin:
[...]
> Guys,
> 
> 	I think your forgetting two things here in this discussion.
> 
> 	1) Python is cross platform, and not Mac Exclusive
> 	2) There are two "time" sections in here.
> 			- Python Time Calls
> 			- Macintosh Time Calls
> 
> 	All Python related Time calls *HAVE* to use a 1900 base.  Period.
> End of story.

Hmmm..... Look:
Python 1.5.2 (#1, Jul 23 1999, 06:38:16)  [GCC egcs-2.91.66 19990314/Linux (egcs- on linux2
Copyright 1991-1995 Stichting Mathematisch Centrum, Amsterdam
>>> import time
>>> time.gmtime(0)
(1970, 1, 1, 0, 0, 0, 3, 1, 0)

And quoting from TFM:

"""The epoch is the point where the time starts. On January 1st of that
year, at 0 hours, the ``time since the epoch'' is zero. For Unix,
the epoch is 1970. To find out what the epoch is, look at gmtime(0)."""

> 	If python time calls are *NOT* based off of 1900, then we will have
> to modify
> 	code, and lose cross platform support, for all other platforms.

epoch is different on all platforms anyway.  If your code relies
on a special value for 'epoch', it is broken^H^H^H^H^H^H less portable
anyway.

> 	All of the Macintosh *ONLY* time calls, ala Apple Events, etc,
> should
> 	be based off the 1904.
> 
> 	If we don't follow that basic rule, then it'll be difficult to be
> 	fully cross platform.
> 
> 	Right now, I developed on a WIN NT box, and then copy the files over
> 	to a Mac to create a applet.  Works great (other than the CR/LF vs
> CR
> 	problems).

You should not forget Linux/Unix.  Especially on the Internet "real"
operating systems (as opposed to WinXX and MacOS <wink> ;-) ) have a 
very strong user base.  

BTW: According to c't (a very respected german computer magacine)
only 10% of the Top100 Webservers run on NT, where Linux allone is
29% and Solaris is 58%.  c't did some research about procentual down
times of these TOP-100 servers.  The result was not very surprising:
NT downtimes were about 1.6% where the Solaris and Linux down times
were ranging from 0.2 to 0.4 percent.  May be this more related to
Apache vs. IIS than to Linux vs. NT.  But from my experience Win NT
sucks and I'm very happy about Python running my programs unchanged
on this brain dead platform without having to bother with it myself.

Regards, Peter