...

View Full Version : gmdate add 1 hour?



Andy92
04-02-2007, 12:30 AM
Hi there,

I had the following php code...



$posted = gmdate("jS F Y \a\\t g:ia");


But now, the clocks have been moved forward 1 hour, and it is displaying the time 1 hour behind?

How can i fix this to make it 1 hour ahed?

:confused:

iLLin
04-02-2007, 12:54 AM
Hmm gmdate is what it is... If you have the incorrect time for your timezone, then you need to change that and not the gmdate as it seems you would put this through a function to get a users timezone? Im just speculating...

NancyJ
04-02-2007, 12:59 AM
contrary to common belief, GMT does not move backwards and forwards. We are now in a different, 'made up' time zone called 'British Summer Time' (or GMT+1) If your server is on BST date() will give you the correct time.

Andy92
04-02-2007, 01:48 AM
Ok,

So how could i do that? I have seen the php date O and you can set it to be +0200 and that would mean 2 hours ahed of gmt, but i havent found any examples?

:confused:

iLLin
04-02-2007, 04:06 AM
mktime() (http://us.php.net/manual/en/function.mktime.php), strtotime() (http://us.php.net/manual/en/function.strtotime.php)

Andy92
04-02-2007, 01:23 PM
Ok,

Thanks for all your help!

Got it fixed now.

Thank you!

:thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum