Created
June 27, 2018 11:24
-
-
Save Marcoevich/2acf22c8c901a36e5ee2660676bc0c10 to your computer and use it in GitHub Desktop.
Fix age calculation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$calculateAge = DateTime::createFromFormat('d/m/Y', $birthdate, $tz); | |
if($calculateAge) { | |
$age = $calculateAge->diff(new DateTime('now', $tz))->y; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment