Merge pull request #44666 from nooblag/occ-user

occ: Improve and make consistent `user:lastseen` and `user:info` timestamps
pull/46945/head
John Molakvoæ 2024-08-07 09:33:24 +07:00 committed by GitHub
commit 80fc2a96f2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 2 deletions

@ -43,6 +43,7 @@ class LastSeen extends Base {
protected function execute(InputInterface $input, OutputInterface $output): int {
$singleUserId = $input->getArgument('uid');
if ($singleUserId) {
$user = $this->userManager->get($singleUserId);
if (is_null($user)) {
@ -56,7 +57,7 @@ class LastSeen extends Base {
} else {
$date = new \DateTime();
$date->setTimestamp($lastLogin);
$output->writeln($user->getUID() . "'s last login: " . $date->format('Y-m-d H:i'));
$output->writeln($user->getUID() . "'s last login: " . $date->format('Y-m-d H:i:s T'));
}
return 0;
@ -74,7 +75,7 @@ class LastSeen extends Base {
} else {
$date = new \DateTime();
$date->setTimestamp($lastLogin);
$output->writeln($user->getUID() . "'s last login: " . $date->format('Y-m-d H:i'));
$output->writeln($user->getUID() . "'s last login: " . $date->format('Y-m-d H:i:s T'));
}
});
return 0;