date("H", $datevalue) always adds an hour?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi All,

Wondering if anyone can help me work out why date("H") always adds an hour? I'm *assuming* it thinks it should be compensating for Daylight Saving Time (though I'd be just as willing to believe that it's caused by something else), however we don't observe DST in Queensland, Australia.

Making matters a little more complex, while my local machine shouldn't be compensating for DST (if that's what's happening), my remote machine (based in Florida somewhere, I think) should, when applicable.

So, just to explain a little better.

Let's say the clock on my computer reads 7:00pm. If I do "echo date("H");" it will output "20", instead of "19".

The same thing happens if I take a date value from my mysql database.

$sql = "SELECT UNIX_TIMESTAMP(datecreated) AS unx_date FROM mytable;"
$rs = mysql_query($sql);
$row = mysql_fetch_object($rs);
echo date("H", $row->unx_date);

If the above record contained the value '2006-01-10 19:00', the code would output "20" instead of "19".

Can anyone help me figure out how to accommodate for this?

Much warmth,

Murray

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux