SammyP Posted March 29, 2006 Share Posted March 29, 2006 I'm doing the right thing and searching for an answer before posting, but I keep getting to posts like the one below with links which are out of date.I've checked the FAQs as well. I'm out of options.Put simply, I need to know the time in London. My server is somewhere in the US. I don't know where. I don't care, as it is easy to find out what GMT is. I need to know though whether London is on DST or not. My server variables all apply to some US time zone which are currently incorrect, and though they change on similar dates, this is not sufficient for weeks like this one. London changes last weekend and the USA changes next weekend. Is there a function or lookup method somewhere which can be used, or do I need to add a table with dates and times for London's DST changes?Thanks Sam.[!--quoteo(post=146492:date=Aug 7 2004, 05:02 PM:name=toplay)--][div class=\'quotetop\']QUOTE(toplay @ Aug 7 2004, 05:02 PM) [snapback]146492[/snapback][/div][div class=\'quotemain\'][!--quotec--]FYI: Timezones:[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=16352&st=0entry59671\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...t=0entry59671[/a]How to handle daylight savings time (DST) (same topic post):[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=16352&st=0entry59851\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...t=0entry59851[/a][/quote] Quote Link to comment Share on other sites More sharing options...
SammyP Posted March 31, 2006 Author Share Posted March 31, 2006 Anybody? This must be possible. Quote Link to comment Share on other sites More sharing options...
keithschm Posted March 31, 2006 Share Posted March 31, 2006 [!--quoteo(post=359612:date=Mar 29 2006, 06:10 AM:name=SammyP)--][div class=\'quotetop\']QUOTE(SammyP @ Mar 29 2006, 06:10 AM) [snapback]359612[/snapback][/div][div class=\'quotemain\'][!--quotec--]I need to know though whether London is on DST or not. [/quote] You can also select a time zone with or without daylight saving time in the Control panel Date/Time Properties.[b] [u]For example (GMT) Casablanca, Monrovia does not support daylight saving time but (GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London does.[/u][/b]just from a search I got this link which included the above info[a href=\"http://www.macromedia.com/cfusion/knowledgebase/index.cfm?id=tn_18310\" target=\"_blank\"]http://www.macromedia.com/cfusion/knowledg...cfm?id=tn_18310[/a] Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted March 31, 2006 Share Posted March 31, 2006 Umm, thats for coldfusion which is totally different to PHP! Quote Link to comment Share on other sites More sharing options...
keithschm Posted March 31, 2006 Share Posted March 31, 2006 [!--quoteo(post=360426:date=Mar 31 2006, 12:50 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Mar 31 2006, 12:50 PM) [snapback]360426[/snapback][/div][div class=\'quotemain\'][!--quotec--]Umm, thats for coldfusion which is totally different to PHP![/quote]umm you asked whether London is on DST or notI gave you and answer.Maybe you should rephrase your question. Quote Link to comment Share on other sites More sharing options...
redbullmarky Posted March 31, 2006 Share Posted March 31, 2006 Hithe 'date' function is quite useful, but depends on how/where, etc you want to use it. but from the manual:[a href=\"http://uk2.php.net/date\" target=\"_blank\"]http://uk2.php.net/date[/a][code]// whether in daylight savings time or notecho date("I");// difference to GMT in hours (eg, +0200)echo date("O");// as above, but with colin (eg +02:00)echo date("P");[/code]hope that helps a little moreCheersMark Quote Link to comment Share on other sites More sharing options...
SammyP Posted April 3, 2006 Author Share Posted April 3, 2006 Thanks but it doesn't help. That function tells me that the time is 5am at the moment which it probably is wherever my server is.I need to know what time it is in London.I can easily get GMT, but sometimes London is not on GMT, like now, as it is on GST. I need to know if that is the case. I guess maybe I can find out how Britain decides its rules for these things and program it, but I'd have thought that there might be a function somewhere.Thanks for trying. Quote Link to comment Share on other sites More sharing options...
litebearer Posted April 3, 2006 Share Posted April 3, 2006 The "hammer-man" is awake. (Hammer-man as in I have a propensity to use the sledge-hammer approach to quickly resolve problems)Here is a bit of code that will scrape data from the world time site. All you need to do is purge the result of any extraneous data.by changing the city value you could use it for most any major city in the world.edit: I seem to be having problems posting code - so you can view the script output here [a href=\"http://nstoia.com/dst.php\" target=\"_blank\"]http://nstoia.com/dst.php[/a]and download the script here [a href=\"http://nstoia.com/dst.zip\" target=\"_blank\"]http://nstoia.com/dst.zip[/a]Hope this is helpful.Lite (aka hammer-man ) Quote Link to comment Share on other sites More sharing options...
SammyP Posted April 3, 2006 Author Share Posted April 3, 2006 Thanks for that. Not a bad idea at all. Should be able to cache the results daily too to speed up loading my pages. Quote Link to comment 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.