[Pythonmac-SIG] file times and time functions...
Kei Ishii
kish@cs.tu-berlin.de
Mon, 3 Apr 2000 13:14:56 +0200
Hello all,
I apologize in advance for this total novice question, just cannot
figure out what I am doing wrong...
Anyway, MacPython 1.5.2c1 (the latest I figure).
The problem:
A given file (${PYTHON}/BuildApplet) has following modification time
(German style: 'dd.mm.yyyy, hh:mm:ss'):
last modified: 12.4.1999, 14:31:43
os.stat, os.path.getmtime, os.xstat and their mac counterparts all
say:
>>>print time.ctime(filemtime)
Thu Apr 13 14:31:43 1995
The difference of course is that of epoch 1.1.1900 vs. 1.1.1904.
>>>time.ctime(0)
'Mon Jan 1 00:00:00 1900'
>>> time.ctime(126144000.0)
'Fri Jan 1 00:00:00 1904'
I grabbed through the Python and C sources, to no avail.
BTW, trying to find out the epoch (according to the Python Library
Reference, gmtime(0)), another funny thing (esp. third command!):
>>> time.asctime(time.gmtime(0))
'Thu Feb 7 04:28:16 2036'
>>> time.asctime(time.gmtime(7200))
'Mon Jan 1 00:00:00 1900'
>>> time.asctime(time.gmtime(7199))
'xxx xxx xx xx:xx:xx xxxx'
>>> time.asctime(time.gmtime(7198))
'Thu Feb 7 06:28:14 2036'
So, what am I doing wrong???
Thanks, Kei.
--
Kei Ishii ÀÐ°æ ·É kish@cs.tu-berlin.de
TU Berlin, FB Informatik, Sekr. FR5-10, Franklinstr. 28/29, 10587 Berlin
"I'm not dumb. I just have a command of thoroughly useless information" Calvin