}
// Legacy Moodle half an hour offsets - pick any city nearby, ideally without DST.
- self::$badzones['-4.5'] = 'America/Caracas';
self::$badzones['4.5'] = 'Asia/Kabul';
self::$badzones['5.5'] = 'Asia/Kolkata';
self::$badzones['6.5'] = 'Asia/Rangoon';
$this->assertSame('Etc/GMT-2', core_date::normalise_timezone('2.0'));
$this->assertSame('Etc/GMT+2', core_date::normalise_timezone(-2));
$this->assertSame('Etc/GMT+2', core_date::normalise_timezone('-2.0'));
+ $this->assertSame('Etc/GMT+4', core_date::normalise_timezone(-4));
$this->assertSame('Etc/GMT-2', core_date::normalise_timezone('UTC+2'));
$this->assertSame('Etc/GMT+2', core_date::normalise_timezone('UTC-2'));
$this->assertSame('Etc/GMT-2', core_date::normalise_timezone('GMT+2'));
$this->assertSame('Etc/GMT-13', core_date::normalise_timezone(13));
$this->assertSame('Pacific/Auckland', core_date::normalise_timezone(14));
- $this->assertSame('America/Caracas', core_date::normalise_timezone(-4.5));
$this->assertSame('Asia/Kabul', core_date::normalise_timezone(4.5));
$this->assertSame('Asia/Kolkata', core_date::normalise_timezone(5.5));
$this->assertSame('Asia/Rangoon', core_date::normalise_timezone(6.5));
<mapZone other="US Eastern Standard Time" territory="001" type="America/Indianapolis"/>
<mapZone other="US Eastern Standard Time" territory="US" type="America/Indianapolis America/Indiana/Marengo America/Indiana/Vevay"/>
- <!-- (UTC-04:30) Caracas -->
+ <!-- (UTC-04:00) Caracas -->
<mapZone other="Venezuela Standard Time" territory="001" type="America/Caracas"/>
<mapZone other="Venezuela Standard Time" territory="VE" type="America/Caracas"/>
<mapZone other="Line Islands Standard Time" territory="ZZ" type="Etc/GMT-14"/>
</mapTimezones>
</windowsZones>
-</supplementalData>
\ No newline at end of file
+</supplementalData>
// The timezones used in this test are chosen because they do not use DST - that would break the test.
$this->resetAfterTest();
- $this->setTimezone('America/Caracas');
+ $this->setTimezone('Asia/Kabul');
$testclass = new \core\task\scheduled_test_task();
$userdate = userdate($nexttime);
// Should be displayed in user timezone.
- // I used http://www.timeanddate.com/worldclock/fixedtime.html?msg=Moodle+Test&iso=20140314T01&p1=58
- // to verify this time.
- $this->assertContains('11:15 AM', core_text::strtoupper($userdate));
+ // I used http://www.timeanddate.com/worldclock/fixedtime.html?msg=Moodle+Test&iso=20160502T01&p1=113
+ // setting my location to Kathmandu to verify this time.
+ $this->assertContains('2:15 AM', core_text::strtoupper($userdate));
}
public function test_reset_scheduled_tasks_for_component() {