Don't add trivial timezone records in the db, we 're going to handle them manually.
This commit is contained in:
@@ -26,22 +26,6 @@ $ddd = olson_todst($CFG->dataroot.'/temp/olson.txt');
|
||||
|
||||
execute_sql('TRUNCATE TABLE '.$CFG->prefix.'timezone');
|
||||
|
||||
$timezone = new stdClass;
|
||||
$timezone->year = 1970;
|
||||
for($i = -13; $i <= 13; $i += .5) {
|
||||
$timezone->gmtoff = $i * HOURSECS;
|
||||
$timezone->name = get_string('timezoneunspecifiedlocation').' / GMT';
|
||||
$timezone->sortkey = 'UNSPECIFIED_'.sprintf('%05d', 13 * HOURSECS + $timezone->gmtoff);
|
||||
if($i < 0) {
|
||||
$timezone->name .= $i;
|
||||
}
|
||||
else if($i > 0) {
|
||||
$timezone->name .= '+'.$i;
|
||||
}
|
||||
insert_record('timezone', $timezone);
|
||||
}
|
||||
|
||||
|
||||
foreach($ddd as $rec) {
|
||||
print_object($rec);
|
||||
insert_record('timezone', $rec);
|
||||
|
||||
Reference in New Issue
Block a user