Skip to content

Commit

Permalink
Merge pull request #49087 from AIlkiv/getting-default-timezone-for-lo…
Browse files Browse the repository at this point in the history
…cal-time
  • Loading branch information
skjnldsv authored Nov 9, 2024
2 parents 2c00f1e + 1ab1bbd commit 8ff3f21
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function process(IEntry $entry): void {
$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);

Expand Down

0 comments on commit 8ff3f21

Please sign in to comment.