aboutsummaryrefslogtreecommitdiffstats
path: root/include/datetime.php
diff options
context:
space:
mode:
authorfriendica <info@friendica.com>2013-12-03 15:35:13 -0800
committerfriendica <info@friendica.com>2013-12-03 15:35:13 -0800
commit6c321be03c8edd062866b1775bca560beec9d602 (patch)
treeb135bbe5fa649ec779405c8a5c2ff2c98e9c6123 /include/datetime.php
parentcb17f8c2d1bc315ea9b271a4cf78cafb5af7141e (diff)
downloadvolse-hubzilla-6c321be03c8edd062866b1775bca560beec9d602.tar.gz
volse-hubzilla-6c321be03c8edd062866b1775bca560beec9d602.tar.bz2
volse-hubzilla-6c321be03c8edd062866b1775bca560beec9d602.zip
reorganise a few included functions - notably identity related functions
Diffstat (limited to 'include/datetime.php')
-rw-r--r--include/datetime.php21
1 files changed, 21 insertions, 0 deletions
diff --git a/include/datetime.php b/include/datetime.php
index 94c2e4f1c..c0503fc7d 100644
--- a/include/datetime.php
+++ b/include/datetime.php
@@ -443,3 +443,24 @@ function cal($y = 0,$m = 0, $links = false, $class='') {
}
+
+
+function z_birthday($dob,$tz,$format="Y-m-d H:i:s") {
+
+ if(! strlen($tz))
+ $tz = 'UTC';
+
+ $tmp_dob = substr($dob,5);
+ if(intval($tmp_dob)) {
+ $y = datetime_convert($tz,$tz,'now','Y');
+ $bd = $y . '-' . $tmp_dob . ' 00:00';
+ $t_dob = strtotime($bd);
+ $now = strtotime(datetime_convert($tz,$tz,'now'));
+ if($t_dob < $now)
+ $bd = $y + 1 . '-' . $tmp_dob . ' 00:00';
+ $birthday = datetime_convert($tz,'UTC',$bd,$format);
+ }
+
+ return $birthday;
+
+}