Jump to content


Photo

Is a particular city is on DST


  • Please log in to reply
8 replies to this topic

#1 SammyP

SammyP
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts
  • LocationLondon

Posted 29 March 2006 - 11:10 AM

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) View Post[/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]


If this has solved your problem, a quick 'Thanks' is appreciated, but marking the thread as 'Solved' is better - it saves a lot of time.

Sam.

#2 SammyP

SammyP
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts
  • LocationLondon

Posted 31 March 2006 - 03:36 PM

Anybody? This must be possible.

If this has solved your problem, a quick 'Thanks' is appreciated, but marking the thread as 'Solved' is better - it saves a lot of time.

Sam.

#3 keithschm

keithschm
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 31 March 2006 - 03:55 PM

[!--quoteo(post=359612:date=Mar 29 2006, 06:10 AM:name=SammyP)--][div class=\'quotetop\']QUOTE(SammyP @ Mar 29 2006, 06:10 AM) View Post[/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. For example (GMT) Casablanca, Monrovia does not support daylight saving time but (GMT) Greenwich Mean Time: Dublin, Edinburgh, Lisbon, London does.


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]

NEED HELP

#4 wildteen88

wildteen88
  • Staff Alumni
  • Advanced Member
  • 10,482 posts
  • LocationUK, Bournemouth

Posted 31 March 2006 - 05:50 PM

Umm, thats for coldfusion which is totally different to PHP!

#5 keithschm

keithschm
  • Members
  • PipPipPip
  • Advanced Member
  • 34 posts

Posted 31 March 2006 - 06:10 PM

[!--quoteo(post=360426:date=Mar 31 2006, 12:50 PM:name=wildteen88)--][div class=\'quotetop\']QUOTE(wildteen88 @ Mar 31 2006, 12:50 PM) View Post[/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.
NEED HELP

#6 redbullmarky

redbullmarky
  • Staff Alumni
  • Advanced Member
  • 2,863 posts
  • LocationBedfordshire, England

Posted 31 March 2006 - 06:19 PM

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]

// 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");

hope that helps a little more

Cheers
Mark
"you have to keep pissing in the wind to learn how to keep your shoes dry..."

I say old chap, that is rather amusing!

#7 SammyP

SammyP
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts
  • LocationLondon

Posted 03 April 2006 - 11:37 AM

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.
If this has solved your problem, a quick 'Thanks' is appreciated, but marking the thread as 'Solved' is better - it saves a lot of time.

Sam.

#8 litebearer

litebearer
  • Members
  • PipPipPip
  • Advanced Member
  • 2,357 posts
  • Locationwhite lake michigan

Posted 03 April 2006 - 12:19 PM

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 )

all the brothers were valiant!

[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture

#9 SammyP

SammyP
  • Members
  • PipPipPip
  • Advanced Member
  • 58 posts
  • LocationLondon

Posted 03 April 2006 - 05:21 PM

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


If this has solved your problem, a quick 'Thanks' is appreciated, but marking the thread as 'Solved' is better - it saves a lot of time.

Sam.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users