Merge branch 'marijn-settings' of ssh://gitlab-fnwi.uva.nl:1337/11166932/WebDB into marijn-settings

This commit is contained in:
Marijn Jansen
2017-01-30 21:49:17 +01:00

View File

@@ -0,0 +1,12 @@
<?php
/**
* calculates the age of a user
* @param string $bdayAsString
* @return int age
*/
function getAge(string $bdayAsString) : int {
$bday = new DateTime($bdayAsString);
$today = new DateTime("now");
$interval = $bday->diff($today);
return $interval->y;
}