Skip to content

Commit

Permalink
Merge pull request #44666 from nooblag/occ-user
Browse files Browse the repository at this point in the history
occ: Improve and make consistent `user:lastseen` and `user:info` timestamps
  • Loading branch information
skjnldsv authored Aug 7, 2024
2 parents cb341fc + 5ec3a7f commit 80fc2a9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions core/Command/User/LastSeen.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ protected function configure(): void {

protected function execute(InputInterface $input, OutputInterface $output): int {
$singleUserId = $input->getArgument('uid');

if ($singleUserId) {
$user = $this->userManager->get($singleUserId);
if (is_null($user)) {
Expand All @@ -56,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} 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;
Expand All @@ -74,7 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
} 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;
Expand Down

0 comments on commit 80fc2a9

Please sign in to comment.