mirror of
https://github.com/openvk/openvk
synced 2025-03-25 18:58:13 +03:00
fix(age): calculation (fixes #1252)
This commit is contained in:
parent
b92bf7f41a
commit
9ef7d2d7c4
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