All mac compilers now use 1904 as the Epoch...

This commit is contained in:
Guido van Rossum 1991-07-27 23:09:30 +00:00
parent 8c11a5c759
commit 00c567ce6f

View file

@ -69,15 +69,13 @@ time_time(self, args)
if (!getnoarg(args)) if (!getnoarg(args))
return NULL; return NULL;
time(&secs); time(&secs);
#ifdef applec /* MPW */ #ifdef macintosh
/* Difference in origin between Mac and Unix clocks: */ /* The Mac epoch is 1904, while UNIX uses 1970; Python prefers 1970 */
/* For THINK C 3.0 add a correction like 5*3600; /* Moreover, the Mac returns local time. This we cannot fix... */
it converts to UCT from local assuming EST */
#define TIMEDIFF ((time_t) \ #define TIMEDIFF ((time_t) \
(((1970-1904)*365L + (1970-1904)/4) * 24 * 3600)) (((1970-1904)*365L + (1970-1904)/4) * 24 * 3600))
secs -= TIMEDIFF; secs -= TIMEDIFF;
/* XXX It's almost better to directly fetch the Mac clock... */ #endif
#endif /* applec */
return newintobject((long)secs); return newintobject((long)secs);
} }