diff options
author | Jore <contact@jore.cc> | 2024-04-05 12:59:37 +1100 |
---|---|---|
committer | skjnldsv <skjnldsv@protonmail.com> | 2024-08-07 09:33:09 +0200 |
commit | a0566f881d57b5dd70bc7459f60f8f293818e289 (patch) | |
tree | f35184c1715f43f96a4ddc3ca80a302dc6651cfc | |
parent | e16e16c97222340ea7559423ef54cd670c607863 (diff) | |
download | nextcloud-server-a0566f881d57b5dd70bc7459f60f8f293818e289.tar.gz nextcloud-server-a0566f881d57b5dd70bc7459f60f8f293818e289.zip |
occ: Add locale setting timezone to timestamps.
Signed-off-by: Jore <contact@jore.cc>
-rw-r--r-- | core/Command/User/Info.php | 7 | ||||
-rw-r--r-- | core/Command/User/LastSeen.php | 5 |
2 files changed, 12 insertions, 0 deletions
diff --git a/core/Command/User/Info.php b/core/Command/User/Info.php index 48d6e074111..0d54ca412c6 100644 --- a/core/Command/User/Info.php +++ b/core/Command/User/Info.php @@ -46,12 +46,18 @@ class Info extends Base { $output->writeln('<error>user not found</error>'); return 1; } + $groups = $this->groupManager->getUserGroupIds($user); + + if (ini_get('date.timezone')) { + date_default_timezone_set(ini_get('date.timezone')); + } if ($user->getLastLogin() == 0) { $lastseen = "never"; } else { $lastseen = date('Y-m-d H:i:s T', $user->getLastLogin()); } + $data = [ 'user_id' => $user->getUID(), 'display_name' => $user->getDisplayName(), @@ -65,6 +71,7 @@ class Info extends Base { 'user_directory' => $user->getHome(), 'backend' => $user->getBackendClassName() ]; + $this->writeArrayInOutputFormat($input, $output, $data); return 0; } diff --git a/core/Command/User/LastSeen.php b/core/Command/User/LastSeen.php index 066377f4cf8..2a94bb89baf 100644 --- a/core/Command/User/LastSeen.php +++ b/core/Command/User/LastSeen.php @@ -43,6 +43,11 @@ class LastSeen extends Base { protected function execute(InputInterface $input, OutputInterface $output): int { $singleUserId = $input->getArgument('uid'); + + if (ini_get('date.timezone')) { + date_default_timezone_set(ini_get('date.timezone')); + } + if ($singleUserId) { $user = $this->userManager->get($singleUserId); if (is_null($user)) { |