2011-05-17 11:02:31 UTC
$timezone = '-8';
$date = gmdate ("m-d-Y" , time() + 3600 * ( $timezone + gmdate(' I ')));
$time = gmdate ("h:i:s A" , time() + 3600 * ( $timezone + gmdate( ' I ')));
Note - I added spaces so Yahoo doesn't cut the code off.
Now here is what I need help with. The $date variable always comes out right, it gives me the proper date, or day I should say, when used. $time however dose not work like it should. It returns a time that is 7 hours ahead of my timezone set at -8.
What am I missing? How can I get the time to come out right? - YES my timezone number is really -8, thats not wrong, and the final part of the code with gmdate(' I ') takes into account day light savings time so even if that part was messed up my time would be off by 1 hour not 7.