| Newsgroups |
php.notes |
| Message-ID |
<[email protected]> |
Don't know about others, but this makes more sense to me:
function dateserial($year,$month,$day,$hour,$minute,$timezone = "UTC") {
$orgTZ = date_default_timezone_get();
date_default_timezone_set($timezone);
$retval = mktime($hour,$minute,0,$month,$day,$year);
date_default_timezone_set($orgTZ);
return $retval;
}
The order makes more sense and the timezone defaults to UTC unless otherwise specified. The fact that you have to set the timezone gives you more control and forces you to be aware of it.
----
Server IP: 195.184.96.15
Probable Submitter: 85.82.198.72
----
Manual Page -- http://www.php.net/manual/en/function.mktime.php
Edit -- https://master.php.net/note/edit/86084
Del: integrated -- https://master.php.net/note/delete/86084/integrated
Del: useless -- https://master.php.net/note/delete/86084/useless
Del: bad code -- https://master.php.net/note/delete/86084/bad+code
Del: spam -- https://master.php.net/note/delete/86084/spam
Del: non-english -- https://master.php.net/note/delete/86084/non-english
Del: in docs -- https://master.php.net/note/delete/86084/in+docs
Del: other reasons-- https://master.php.net/note/delete/86084
Reject -- https://master.php.net/note/reject/86084
Search -- https://master.php.net/manage/user-notes.php