mirror of
https://github.com/openvk/openvk
synced 2025-04-18 22:23:04 +03:00
fix(age): calculation
This commit is contained in:
parent
def76226b7
commit
2abf4f0bd6
1 changed files with 4 additions and 1 deletions
|
@ -524,7 +524,10 @@ class User extends RowModel
|
|||
|
||||
public function getAge(): ?int
|
||||
{
|
||||
return (int) floor((time() - $this->getBirthday()->timestamp()) / YEAR);
|
||||
$birthday = new \DateTime();
|
||||
$birthday->setTimestamp($this->getBirthday()->timestamp());
|
||||
$today = new \DateTime();
|
||||
return (int) $today->diff($birthday)->y;
|
||||
}
|
||||
|
||||
public function get2faSecret(): ?string
|
||||
|
|
Loading…
Reference in a new issue