getProperty('UID'); $targetUser = $this->userManager->get($targetUserId); if (!empty($targetUser)) { $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); $iconUrl = $this->urlGenerator->getAbsoluteURL($this->urlGenerator->imagePath('core', 'actions/recent.svg')); $l = $this->l10nFactory->get('lib'); $profileActionText = $l->t('Local time: %s', [$localTime]); $action = $this->actionFactory->newLinkAction($iconUrl, $profileActionText, '#', 'timezone'); // Order after the profile page $action->setPriority(19); $entry->addAction($action); } } }