Jump to content

Archived

This topic is now archived and is closed to further replies.

j4ymf

british summer time

Recommended Posts

hello i use this code

[b] [!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]$now = date("G:i a");[!--colorc--][/span][!--/colorc--][/b]

but because the clocks have changed the time i am showing is an hour wrong any ideas?


can i do somthing like G+1


thanks jason

Share this post


Link to post
Share on other sites
You're going to have to use the mktime() function to add an hour. However, I suggest you figure out something in terms of server configuration otherwise you'll have problems when the time changes back.

Share this post


Link to post
Share on other sites
[!--quoteo(post=359742:date=Mar 29 2006, 05:53 PM:name=ober)--][div class=\'quotetop\']QUOTE(ober @ Mar 29 2006, 05:53 PM) [snapback]359742[/snapback][/div][div class=\'quotemain\'][!--quotec--]
You're going to have to use the mktime() function to add an hour. However, I suggest you figure out something in terms of server configuration otherwise you'll have problems when the time changes back.
[/quote]

thankyou i will look into it

Share this post


Link to post
Share on other sites
PHP gets the time from the server itself. The servers clock should be configured to update automatically it should add an hour or take an hour away when the clocks go forward or back this process is automatic so you shouldn't have to worry about adding/removing hours from your times.

SO I would look into your how your server is configured. All PC/Laptops/Servers or what ever shoud do this. I think computers/servers will only do this if a setting called [b]Daylight saving changes[/b] is set.

Share this post


Link to post
Share on other sites
wildteen, I'm going to assume that "british summer time" is different from DST. The clocks don't change here for another week or so. This all may be dependent on where the server is physically located.

Share this post


Link to post
Share on other sites
Yeah I guess j4ymf is absed in the UK like me but his site may be hosted in another time zone otherthan GMT. Didn't think of that.

Share this post


Link to post
Share on other sites
hello ive got round it
[!--coloro:#FF0000--][span style=\"color:#FF0000\"][!--/coloro--]echo date('G:i a', strtotime('+1 hour'));[!--colorc--][/span][!--/colorc--]

so do i need to ask my host where there server is based, if it is in the uk it should do its self am i right?





this is the reply i got from my server

Our servers, like practically all other internet servers, run on UTC/GMT. If you wish your site to display the time in British Summer Time, you will need to adjust your script.

so what does this mean??

Share this post


Link to post
Share on other sites
That means that you should either put something in your script to detect when it goes past date x and calculate the date accordingly. Either that or you'll have to update the script everytime the time shifts.

OR... you could take the date off of your site completely and let your users get the date and time from their own computers!

OR you could post the time and specify that it's based off of GMT.

Share this post


Link to post
Share on other sites
thankyou very much for your help

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.