note 86749 deleted from function.date by danbrown
| From: | danbrown@php.net | Date: | Sun, 02 Nov 2008 15:18:43 +0000 |
| Subject: | note 86749 deleted from function.date by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-146052@lists.php.net to get a copy of this message | ||
Note Submitter: ambuy at example dot com
----
function to add hours to date or datetime
===================================
function now($hour_add = 13, $date_only = 0){
if ($date_only == 0){
$newtime = mktime(date("H")+$hour_add, date("i"), date("s"),
date("m"), date("d"), date("Y"));
return date("Y-m-d H:i:s",$newtime);
}else{
$newtime = mktime(date("H")+$hour_add, date("i"), date("s"),
date("m"), date("d"), date("Y"));
return date("Y-m-d",$newtime);
}
}