6
6
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
9
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.62 2009/01/01 17:24:04 momjian Exp $
9
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.63 2009/06/11 14:49:15 momjian Exp $
11
11
*-------------------------------------------------------------------------
387
387
* enough to identify DST transition rules, since everybody switches on
388
388
* Sundays.) This is sufficient to cover most of the Unix time_t range,
389
389
* and we don't want to look further than that since many systems won't
390
* have sane TZ behavior further back anyway. The further
391
* back the zone matches, the better we score it. This may seem like a
392
* rather random way of doing things, but experience has shown that
393
* system-supplied timezone definitions are likely to have DST behavior
394
* that is right for the recent past and not so accurate further back.
395
* Scoring in this way allows us to recognize zones that have some
396
* commonality with the zic database, without insisting on exact match.
397
* (Note: we probe Thursdays, not Sundays, to avoid triggering
398
* DST-transition bugs in localtime itself.)
390
* have sane TZ behavior further back anyway. The further back the zone
391
* matches, the better we score it. This may seem like a rather random
392
* way of doing things, but experience has shown that system-supplied
393
* timezone definitions are likely to have DST behavior that is right for
394
* the recent past and not so accurate further back. Scoring in this way
395
* allows us to recognize zones that have some commonality with the zic
396
* database, without insisting on exact match. (Note: we probe Thursdays,
397
* not Sundays, to avoid triggering DST-transition bugs in localtime
400
400
tnow = time(NULL);
401
401
tm = localtime(&tnow);
404
404
thisyear = tm->tm_year + 1900;
406
406
t = build_time_t(thisyear, 1, 15);
408
409
* Round back to GMT midnight Thursday. This depends on the knowledge
409
410
* that the time_t origin is Thu Jan 01 1970. (With a different origin
731
732
"Central Standard Time (Mexico)", "Central Daylight Time (Mexico)",
732
733
"America/Mexico_City"
733
734
}, /* (GMT-06:00) Guadalajara, Mexico City,
736
737
"China Standard Time", "China Daylight Time",
853
854
"Mountain Standard Time (Mexico)", "Mountain Daylight Time (Mexico)",
854
855
"America/Chihuahua"
855
}, /* (GMT-07:00) Chihuahua, La Paz,
856
}, /* (GMT-07:00) Chihuahua, La Paz, Mazatlan -
858
859
"Myanmar Standard Time", "Myanmar Daylight Time",
974
975
"Australia/Perth"
975
976
}, /* (GMT+08:00) Perth */
976
977
/* {"W. Central Africa Standard Time", "W. Central Africa Daylight Time",
977
* * * * * * * ""}, Could not find a match for this one. Excluded for now. *//* (
978
* * * * * * * * ""}, Could not find a match for this one. Excluded for now. *//* (
978
979
* G MT+01:00) West Central Africa */
980
981
"W. Europe Standard Time", "W. Europe Daylight Time",
1492
1493
* Load this timezone using tzload() not pg_tzset(), so we don't fill
1495
if (tzload(fullname + dir->baselen, dir->tz.TZname, &dir->tz.state,
1496
if (tzload(fullname + dir->baselen, dir->tz.TZname, &dir->tz.state,
1498
1499
/* Zone could not be loaded, ignore it */