Jump to content

Archived

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

SammyP

Is a particular city is on DST

Recommended Posts

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=0&#entry59671\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...t=0&#entry59671[/a]

How to handle daylight savings time (DST) (same topic post):
[a href=\"http://www.phpfreaks.com/forums/index.php?showtopic=16352&st=0&#entry59851\" target=\"_blank\"]http://www.phpfreaks.com/forums/index.php?...t=0&#entry59851[/a]
[/quote]

Share this post


Link to post
Share on other sites
[!--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]

Share this post


Link to post
Share on other sites
Umm, thats for coldfusion which is totally different to PHP!

Share this post


Link to post
Share on other sites
[!--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 not

I gave you and answer.

Maybe you should rephrase your question.

Share this post


Link to post
Share on other sites
Hi

the '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 not
echo 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 more

Cheers
Mark

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
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 )

Share this post


Link to post
Share on other sites
Thanks for that. Not a bad idea at all. Should be able to cache the results daily too to speed up loading my pages.

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.