note 98532 added to book.datetime
| From: | Moo0z0r at osu1 dot php dot net | Date: | Mon, 21 Jun 2010 18:58:46 +0000 |
| Subject: | note 98532 added to book.datetime | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-170351@lists.php.net to get a copy of this message | ||
I think it's important to mention with the DateTime class that if you're trying to create
a system that should store UNIX timestamps in UTC/GMT, and then convert them to a desired custom
time-zone when they need to be displayed, using the following code is a good idea:
<?php
date_default_timezone_set('UTC');
?>
Even if you use something like:
<?php
$date->setTimezone( new DateTimeZone('UTC') );
?>
... before you store the value, it doesn't seem to work because PHP is already trying to
convert it to the default timezone.
----
Server IP: 69.147.83.197
Probable Submitter: 90.202.70.222
----
Manual Page -- http://www.php.net/manual/en/book.datetime.php
Edit -- https://master.php.net/note/edit/98532
Del: integrated -- https://master.php.net/note/delete/98532/integrated
Del: useless -- https://master.php.net/note/delete/98532/useless
Del: bad code -- https://master.php.net/note/delete/98532/bad+code
Del: spam -- https://master.php.net/note/delete/98532/spam
Del: non-english -- https://master.php.net/note/delete/98532/non-english
Del: in docs -- https://master.php.net/note/delete/98532/in+docs
Del: other reasons-- https://master.php.net/note/delete/98532
Reject -- https://master.php.net/note/reject/98532
Search -- https://master.php.net/manage/user-notes.php