Re: date() confustion
| From: | marco@behnke.biz | Date: | Thu, 26 Apr 2012 07:09:22 +0000 |
| Subject: | Re: date() confustion | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-317692@lists.php.net to get a copy of this message | ||
Nathan Nobbe <quickshiftin@gmail.com> hat am 26. April 2012 um 06:40
geschrieben:
>
> INSERT TIMESTAMP: 1335414561
> INSERT DATE TIME: 2012-04-26 4:29:21
>
> But then from the interactive interpreter on the same box (same php.ini
as
> well):
>
> php > echo date("Y-m-d G:i:s", 1335414561);
> 2012-04-25 22:29:21
>
> I get this same output from another random computer of mine and I've
> verified date.timezone is consistent in both environments.
>
This definitly looks like a timezone offset!
Try the following code in your environments.
$date = new DateTime ( );
$tz = $date -> getTimezone ();
echo $tz -> getName ();
PHP for CLI mode has a different php.ini than the one for apache2. Maybe
that is a problem?
Check also
php -i | grep "date.timezone"