note 68310 deleted from function.time by aidan

From: Date: Fri, 17 Apr 2009 21:39:14 +0000
Subject: note 68310 deleted from function.time by aidan
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-153456@lists.php.net to get a copy of this message
Note Submitter: STaRDoGGCHaMP ---- This function formate a timestamp into days, hours, minutes and seconds. e.g the time until your birthday. <?php function formatetimestamp($until){ $now = time(); $difference = $until - $now; $days = floor($difference/86400); $difference = $difference - ($days*86400); $hours = floor($difference/3600); $difference = $difference - ($hours*3600); $minutes = floor($difference/60); $difference = $difference - ($minutes*60); $seconds = $difference; $output = "You have to wait $days Days, $hours Hours, $minutes Minutes and $seconds Seconds until this Day."; return $output; } //int mktime ( [int hour [, int minute [, int second [, int month [, int day [, int year [, int is_dst]]]]]]] ) echo formatetimestamp(mktime(0,0,0,12,31,2006)); //output: e.g "You have to wait 162 Days, 4 Hours, 38 Minutes and 46 Seconds until this Day" ?>

« previous php.notes (#153456) next »