Merge pull request #49087 from AIlkiv/getting-default-timezone-for-local-time

pull/48561/head
John Molakvoæ 2024-11-09 14:23:45 +07:00 committed by GitHub
commit 8ff3f21f1d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

@ -35,7 +35,7 @@ class LocalTimeProvider implements IProvider {
$targetUserId = $entry->getProperty('UID');
$targetUser = $this->userManager->get($targetUserId);
if (!empty($targetUser)) {
$timezone = $this->config->getUserValue($targetUser->getUID(), 'core', 'timezone') ?: date_default_timezone_get();
$timezone = $this->config->getUserValue($targetUser->getUID(), 'core', 'timezone') ?: $this->config->getSystemValueString('default_timezone', 'UTC');
$dateTimeZone = new \DateTimeZone($timezone);
$localTime = $this->dateTimeFormatter->formatTime($this->timeFactory->getDateTime(), 'short', $dateTimeZone);