Skip to content

Commit 80fc2a9

Browse files
authored
Merge pull request #44666 from nooblag/occ-user
occ: Improve and make consistent `user:lastseen` and `user:info` timestamps
2 parents cb341fc + 5ec3a7f commit 80fc2a9

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

core/Command/User/LastSeen.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ protected function configure(): void {
4343

4444
protected function execute(InputInterface $input, OutputInterface $output): int {
4545
$singleUserId = $input->getArgument('uid');
46+
4647
if ($singleUserId) {
4748
$user = $this->userManager->get($singleUserId);
4849
if (is_null($user)) {
@@ -56,7 +57,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
5657
} else {
5758
$date = new \DateTime();
5859
$date->setTimestamp($lastLogin);
59-
$output->writeln($user->getUID() . "'s last login: " . $date->format('Y-m-d H:i'));
60+
$output->writeln($user->getUID() . "'s last login: " . $date->format('Y-m-d H:i:s T'));
6061
}
6162

6263
return 0;
@@ -74,7 +75,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
7475
} else {
7576
$date = new \DateTime();
7677
$date->setTimestamp($lastLogin);
77-
$output->writeln($user->getUID() . "'s last login: " . $date->format('Y-m-d H:i'));
78+
$output->writeln($user->getUID() . "'s last login: " . $date->format('Y-m-d H:i:s T'));
7879
}
7980
});
8081
return 0;

0 commit comments

Comments
 (0)