note 72522 added to function.date-default-timezone-set
| From: | brentlrussell at gmail dot com | Date: | Tue, 23 Jan 2007 02:42:31 +0000 |
| Subject: | note 72522 added to function.date-default-timezone-set | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-122052@lists.php.net to get a copy of this message | ||
Changing the date for a certain section of your script can be a bit tricky by changing environment
variables. Here is an example of how to change the the timezone and then change it back
$current_dtime = date_default_timezone_get(); // Get the current time and set it to a variable
date_default_timezone_set("America/Chicago"); // Set the timezone to Central time, or
choose another
/*
// do a bunch of stuff here while the timezone is changed
*/
date_default_timezone_set($current_dtime); // Now it is set back to the original timezone
?>
----
Server IP: 203.202.10.60
Probable Submitter: 202.20.68.6
----
Manual Page -- http://www.php.net/manual/en/function.date-default-timezone-set.php
Edit -- https://master.php.net/note/edit/72522
Del: integrated -- https://master.php.net/note/delete/72522/integrated
Del: useless -- https://master.php.net/note/delete/72522/useless
Del: bad code -- https://master.php.net/note/delete/72522/bad+code
Del: spam -- https://master.php.net/note/delete/72522/spam
Del: non-english -- https://master.php.net/note/delete/72522/non-english
Del: in docs -- https://master.php.net/note/delete/72522/in+docs
Del: other reasons-- https://master.php.net/note/delete/72522
Reject -- https://master.php.net/note/reject/72522
Search -- https://master.php.net/manage/user-notes.php