mirror of
https://github.com/openvk/openvk
synced 2024-11-11 01:19:53 +03:00
Global: Define standard unix time values
Thanks @vladislav805 for the idea!
This commit is contained in:
parent
5d47549442
commit
efa89e075f
2 changed files with 9 additions and 1 deletions
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in a new issue