Skip to content

Commit

Permalink
fix: Getting default timezone for local time
Browse files Browse the repository at this point in the history
Signed-off-by: Andrii Ilkiv <[email protected]>
  • Loading branch information
AIlkiv committed Nov 5, 2024
1 parent 4a44d6a commit 1ab1bbd
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 1ab1bbd

Please sign in to comment.