diff --git a/Web/Models/Entities/User.php b/Web/Models/Entities/User.php index e810bf0f..81d6cc08 100644 --- a/Web/Models/Entities/User.php +++ b/Web/Models/Entities/User.php @@ -324,7 +324,7 @@ class User extends RowModel function getAge(): ?int { - return (int)floor((time() - $this->getBirthday()->timestamp()) / mktime(0, 0, 0, 1, 1, 1971)); + return (int)floor((time() - $this->getBirthday()->timestamp()) / YEAR); } function get2faSecret(): ?string diff --git a/bootstrap.php b/bootstrap.php index 1a52140c..c4ac5395 100644 --- a/bootstrap.php +++ b/bootstrap.php @@ -232,6 +232,14 @@ return (function() { else $ver = "Build 15"; + // Unix time constants + define('MINUTE', 60); + define('HOUR', 60 * MINUTE); + define('DAY', 24 * HOUR); + define('WEEK', 7 * DAY); + define('MONTH', 30 * DAY); + define('YEAR', 365 * DAY); + define("nullptr", NULL); define("OPENVK_DEFAULT_INSTANCE_NAME", "OpenVK", false); define("OPENVK_VERSION", "Altair Preview ($ver)", false);