aboutsummaryrefslogtreecommitdiffstats
path: root/include/datetime.php
diff options
context:
space:
mode:
authorChristian Vogeley <christian.vogeley@hotmail.de>2013-12-22 14:31:27 +0100
committerChristian Vogeley <christian.vogeley@hotmail.de>2013-12-22 14:31:27 +0100
commit870df76463a1cc9823b364db0bfb387f3f46664f (patch)
treea8c7391bfe799703aa0a8f26b9ee788f1204e8be /include/datetime.php
parent25a533bd72c34e9775af71c010a39db6caf7b633 (diff)
parent7e7b5bfa4930493a8feae10b0550e29797956c70 (diff)
downloadvolse-hubzilla-870df76463a1cc9823b364db0bfb387f3f46664f.tar.gz
volse-hubzilla-870df76463a1cc9823b364db0bfb387f3f46664f.tar.bz2
volse-hubzilla-870df76463a1cc9823b364db0bfb387f3f46664f.zip
Merge remote-tracking branch 'upstream/master' into bootstrap
Conflicts: view/php/theme_init.php
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;
+
+}