Skip to content

Commit 36e9e62

Browse files
authored
Replace GMT with UTC (joomla#43912)
1 parent 5b87984 commit 36e9e62

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed

administrator/components/com_actionlogs/src/Model/ActionlogsModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ private function buildDateRange($range)
210210
$dStart->setTime(0, 0, 0);
211211

212212
// Now change the timezone back to UTC.
213-
$tz = new \DateTimeZone('GMT');
213+
$tz = new \DateTimeZone('UTC');
214214
$dStart->setTimezone($tz);
215215
break;
216216
}

administrator/components/com_scheduler/src/Model/TaskModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ public function save($data): bool
612612
$basisDayOfMonth = $data['execution_rules']['exec-day'];
613613
[$basisHour, $basisMinute] = explode(':', $data['execution_rules']['exec-time']);
614614

615-
$data['last_execution'] = Factory::getDate('now', 'GMT')->format('Y-m')
615+
$data['last_execution'] = Factory::getDate('now', 'UTC')->format('Y-m')
616616
. "-$basisDayOfMonth $basisHour:$basisMinute:00";
617617
} else {
618618
$data['last_execution'] = $this->getItem($id)->last_execution;

administrator/components/com_scheduler/src/Model/TasksModel.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ static function (TaskOption $taskOption): string {
251251
$due = $this->getState('filter.due');
252252

253253
if (is_numeric($due) && $due != 0) {
254-
$now = Factory::getDate('now', 'GMT')->toSql();
254+
$now = Factory::getDate('now', 'UTC')->toSql();
255255
$operator = $due == 1 ? ' <= ' : ' > ';
256256
$filterCount++;
257257
$query->where($db->quoteName('a.next_execution') . $operator . ':now')
@@ -268,7 +268,7 @@ static function (TaskOption $taskOption): string {
268268
$locked = $this->getState('filter.locked');
269269

270270
if (is_numeric($locked) && $locked != 0) {
271-
$now = Factory::getDate('now', 'GMT');
271+
$now = Factory::getDate('now', 'UTC');
272272
$timeout = ComponentHelper::getParams('com_scheduler')->get('timeout', 300);
273273
$timeout = new \DateInterval(\sprintf('PT%dS', $timeout));
274274
$timeoutThreshold = (clone $now)->sub($timeout)->toSql();

administrator/components/com_scheduler/src/Task/Task.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public function acquireLock(): bool
307307
$db = $this->db;
308308
$query = $db->getQuery(true);
309309
$id = $this->get('id');
310-
$now = Factory::getDate('now', 'GMT');
310+
$now = Factory::getDate('now', 'UTC');
311311

312312
$timeout = ComponentHelper::getParams('com_scheduler')->get('timeout', 300);
313313
$timeout = new \DateInterval(\sprintf('PT%dS', $timeout));

administrator/components/com_users/src/Model/UsersModel.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -567,7 +567,7 @@ private function buildDateRange($range)
567567
$dStart->setTime(0, 0, 0);
568568

569569
// Now change the timezone back to UTC.
570-
$tz = new \DateTimeZone('GMT');
570+
$tz = new \DateTimeZone('UTC');
571571
$dStart->setTimezone($tz);
572572
break;
573573
case 'never':

build/bump.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ function usage($command)
162162
'build' => '',
163163
'reldate' => $date->format('j-F-Y'),
164164
'reltime' => $date->format('H:i'),
165-
'reltz' => 'GMT',
165+
'reltz' => 'UTC',
166166
'credate' => $date->format('Y-m'),
167167
];
168168

libraries/src/Date/Date.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ public function __construct($date = 'now', $tz = null)
100100
// Create the base GMT and server time zone objects.
101101
if (empty(self::$gmt) || empty(self::$stz)) {
102102
// @TODO: This code block stays here only for B/C, can be removed in 5.0
103-
self::$gmt = new \DateTimeZone('GMT');
103+
self::$gmt = new \DateTimeZone('UTC');
104104
self::$stz = new \DateTimeZone(@date_default_timezone_get());
105105
}
106106

libraries/src/User/User.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -542,7 +542,7 @@ public function setLastVisit($timestamp = null)
542542
*/
543543
public function getTimezone()
544544
{
545-
$timezone = $this->getParam('timezone', Factory::getApplication()->get('offset', 'GMT'));
545+
$timezone = $this->getParam('timezone', Factory::getApplication()->get('offset', 'UTC'));
546546

547547
return new \DateTimeZone($timezone);
548548
}

libraries/src/Version.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ final class Version
107107
* @var string
108108
* @since 3.5
109109
*/
110-
public const RELTZ = 'GMT';
110+
public const RELTZ = 'UTC';
111111

112112
/**
113113
* Copyright Notice.

plugins/system/webauthn/src/CredentialRepository.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ private function formatDate($date, ?string $format = null, bool $tzAware = true)
622622
try {
623623
$tzDefault = Factory::getApplication()->get('offset');
624624
} catch (\Exception $e) {
625-
$tzDefault = 'GMT';
625+
$tzDefault = 'UTC';
626626
}
627627

628628
$user = Factory::getContainer()->get(UserFactoryInterface::class)->loadUserById($userId ?? 0);

0 commit comments

Comments
 (0)