PDA

View Full Version : WEIRD!!! PHP Clock 12 hours ahead?!


chrisvmarle
01-11-2003, 11:41 PM
Hi All,

This is about the weirdest problem I've ever had...

It seems that the time PHP returns (using something simple like: <?=date("Y-m-d h:i:s")?>) is 12 hours ahead:confused:

Has anybody got any idea how to fix this?!? :confused:

Thanks in advance
Mzzl, Chris

Phip
01-11-2003, 11:55 PM
hehe, it's getting the time of the server. which is probably 12 hours difference of what you are.

chrisvmarle
01-12-2003, 10:11 AM
The server ís my computer...

Nightfire
01-12-2003, 11:17 AM
Sure your clock is set right? :confused:

chrisvmarle
01-12-2003, 01:39 PM
yep

duniyadnd
01-12-2003, 06:03 PM
try using gmdate(), it should give you the GMT time, and then you'll know if its just the way its reading date() is wrong, or it is indeed your server. Check your BIOS clock.

Duniyadnd

chrisvmarle
01-12-2003, 06:12 PM
I think I've found the problem:
"Y-m-d h:i:s" doesn't return AM/PM ("A" is needed for that "Y-m-d h:i:s A") so the time was right, but I expected a 24 hour format...

My bad

Mzzl, Chris

Changed:
<?=date("Y-m-d h:i:s")?>
to:
<?=date("Y-m-d H:i:s")?>