The mktime routine in MetroWerks MSL C Runtime Library on the Mac
uses midnight 1 Jan 1900 as the epoch. So we need to adjust its return value to the NSPR epoch. Thanks to Brendan Eich and Chris Yeh for this fix. git-svn-id: svn://10.0.0.236/trunk@15607 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -1567,6 +1567,15 @@ PR_ParseTimeString(
|
||||
secs = mktime(&localTime);
|
||||
if (secs != (time_t) -1)
|
||||
{
|
||||
#if defined(XP_MAC)
|
||||
/*
|
||||
* The mktime() routine in MetroWerks MSL C
|
||||
* Runtime library returns seconds since midnight,
|
||||
* 1 Jan. 1900, not 1970. So we need to adjust
|
||||
* its return value to the NSPR epoch.
|
||||
*/
|
||||
secs -= ((365 * 70UL) + 17) * 24 * 60 * 60;
|
||||
#endif
|
||||
LL_I2L(*result, secs);
|
||||
LL_I2L(usec_per_sec, PR_USEC_PER_SEC);
|
||||
LL_MUL(*result, *result, usec_per_sec);
|
||||
|
||||
Reference in New Issue
Block a user