note 88236 added to function.mktime
| From: | ronnie dot kurniawan at gmail dot com | Date: | Fri, 16 Jan 2009 17:49:28 +0000 |
| Subject: | note 88236 added to function.mktime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-149325@lists.php.net to get a copy of this message | ||
Add (and subtract) unixtime:
function utime_add($unixtime, $hr=0, $min=0, $sec=0, $mon=0, $day=0, $yr=0) {
$dt = localtime($unixtime, true);
$unixnewtime = mktime(
$dt['tm_hour']+$hr, $dt['tm_min']+$min, $dt['tm_sec']+$sec,
$dt['tm_mon']+1+$mon, $dt['tm_mday']+$day,
$dt['tm_year']+1900+$yr);
return $unixnewtime;
}
----
Server IP: 202.158.52.162
Probable Submitter: 118.136.122.203
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- https://master.php.net/note/edit/88236
Del: integrated -- https://master.php.net/note/delete/88236/integrated
Del: useless -- https://master.php.net/note/delete/88236/useless
Del: bad code -- https://master.php.net/note/delete/88236/bad+code
Del: spam -- https://master.php.net/note/delete/88236/spam
Del: non-english -- https://master.php.net/note/delete/88236/non-english
Del: in docs -- https://master.php.net/note/delete/88236/in+docs
Del: other reasons-- https://master.php.net/note/delete/88236
Reject -- https://master.php.net/note/reject/88236
Search -- https://master.php.net/manage/user-notes.php