Bug #54253 [Bgs]: Date H (and h) returns +7 hours

From: Date: Mon, 14 Mar 2011 23:03:06 +0000
Subject: Bug #54253 [Bgs]: Date H (and h) returns +7 hours
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-159478@lists.php.net to get a copy of this message
Edit report at http://bugs.php.net/bug.php?id=54253&edit=1 ID: 54253 Updated by: rasmus@php.net Reported by: sunco007 at hotmail dot com Summary: Date H (and h) returns +7 hours Status: Bogus Type: Bug Package: Date/time related Operating System: Windows 7 x32 PHP Version: 5.3.5 Block user comment: N Private report: N New Comment: Or I guess you are Pacific actually. Then use: date_default_timezone_set('America/Los_Angeles'); Previous Comments: ------------------------------------------------------------------------ [2011-03-15 00:02:00] rasmus@php.net Set your timezone. You are getting UTC back. date_default_timezone_set('America/Denver'); ------------------------------------------------------------------------ [2011-03-14 23:58:07] sunco007 at hotmail dot com Description: ------------ Want to get the date without any calculations and i got it wrong Is 15:54:09 and Php.. date("H:i:s") returns me 22:54:09 date("h:i:s") returns me 10:54:09 Maybe you need to check exactly on March 14 2011 to see the same result as me Test script: --------------- <? echo date("H:i:s"); // or echo date("h:i:s"); ?> Expected result: ---------------- Current time Actual result: -------------- The time +7 hours ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/bug.php?id=54253&edit=1

« previous php.bugs (#159478) next »