mirror of
https://github.com/nextcloud/server.git
synced 2026-06-06 07:13:23 -04:00
Merge pull request #44666 from nooblag/occ-user
occ: Improve and make consistent `user:lastseen` and `user:info` timestamps
This commit is contained in:
commit
80fc2a96f2
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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue