diff --git a/src/Models/User.php b/src/Models/User.php index f5e47bf7..67ccbdd4 100644 --- a/src/Models/User.php +++ b/src/Models/User.php @@ -362,19 +362,41 @@ public function getBadPasswordTime() } /** - * Returns the formatted timestamp of the password last set date. + * Returns the bad password time unix timestamp. + * + * @return float|null + */ + public function getBadPasswordTimestamp() + { + if ($time = $this->getBadPasswordTime()) { + return Utilities::convertWindowsTimeToUnixTime($time); + } + } + + /** + * Returns the formatted timestamp of the bad password date. * * @return string|null * * @throws \Exception */ - public function getPasswordLastSetDate() + public function getBadPasswordDate() { - if ($timestamp = $this->getPasswordLastSetTimestamp()) { + if ($timestamp = $this->getBadPasswordTimestamp()) { return (new DateTime())->setTimestamp($timestamp)->format($this->dateFormat); } } + /** + * Returns the time when the users password was set last. + * + * @return string + */ + public function getPasswordLastSet() + { + return $this->getFirstAttribute($this->schema->passwordLastSet()); + } + /** * Returns the password last set unix timestamp. * @@ -388,13 +410,17 @@ public function getPasswordLastSetTimestamp() } /** - * Returns the time when the users password was set last. + * Returns the formatted timestamp of the password last set date. * - * @return string + * @return string|null + * + * @throws \Exception */ - public function getPasswordLastSet() + public function getPasswordLastSetDate() { - return $this->getFirstAttribute($this->schema->passwordLastSet()); + if ($timestamp = $this->getPasswordLastSetTimestamp()) { + return (new DateTime())->setTimestamp($timestamp)->format($this->dateFormat); + } } /**