]> git.mxchange.org Git - friendica.git/blobdiff - src/Util/Temporal.php
Merge pull request #10257 from annando/apcontact-no-normalize
[friendica.git] / src / Util / Temporal.php
index c4a04d586cb266cd32d647617fe99056bdd420f6..af82df4becbfffa926552e347549255068ef5af0 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * @copyright Copyright (C) 2020, Friendica
+ * @copyright Copyright (C) 2010-2021, the Friendica project
  *
  * @license GNU AGPL version 3 or any later version
  *
@@ -366,7 +366,7 @@ class Temporal
         * @return int Age in years
         * @throws \Exception
         */
-       public static function getAgeByTimezone($dob, $owner_tz = '')
+       public static function getAgeByTimezone($dob, $owner_tz = ''): int
        {
                if (!intval($dob)) {
                        return 0;
@@ -381,7 +381,7 @@ class Temporal
 
                $interval = $birthdate->diff($currentDate);
 
-               return $interval->format('%y');
+               return (int) $interval->format('%y');
        }
 
        /**