j4ymf Posted March 29, 2006 Share Posted March 29, 2006 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+1thanks jason Quote Link to comment https://forums.phpfreaks.com/topic/6115-british-summer-time/ Share on other sites More sharing options...
ober Posted March 29, 2006 Share Posted March 29, 2006 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 Link to comment https://forums.phpfreaks.com/topic/6115-british-summer-time/#findComment-22028 Share on other sites More sharing options...
j4ymf Posted March 29, 2006 Author Share Posted March 29, 2006 [!--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 Quote Link to comment https://forums.phpfreaks.com/topic/6115-british-summer-time/#findComment-22031 Share on other sites More sharing options...
wildteen88 Posted March 29, 2006 Share Posted March 29, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/6115-british-summer-time/#findComment-22034 Share on other sites More sharing options...
ober Posted March 29, 2006 Share Posted March 29, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/6115-british-summer-time/#findComment-22043 Share on other sites More sharing options...
wildteen88 Posted March 29, 2006 Share Posted March 29, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/6115-british-summer-time/#findComment-22046 Share on other sites More sharing options...
j4ymf Posted March 29, 2006 Author Share Posted March 29, 2006 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 serverOur 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?? Quote Link to comment https://forums.phpfreaks.com/topic/6115-british-summer-time/#findComment-22060 Share on other sites More sharing options...
ober Posted March 29, 2006 Share Posted March 29, 2006 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. Quote Link to comment https://forums.phpfreaks.com/topic/6115-british-summer-time/#findComment-22074 Share on other sites More sharing options...
j4ymf Posted March 29, 2006 Author Share Posted March 29, 2006 thankyou very much for your help Quote Link to comment https://forums.phpfreaks.com/topic/6115-british-summer-time/#findComment-22077 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.