I need to send an email to users based wherever in the world at 9:00 am local time. The server is in the UK. What I can do is set up a time difference between each user and the server's time, which would then perfectly work if DST didn't exist.

Here's an example to illustrate it:

John works in New York, -5 hours from the server (UK) time

Richard works in London, UK, so 0 hour difference with the server.

When the server goes from GMT to GMT +1 (BST) at 2:00am on a certain Sunday, this means that John now has a -6H time difference now.
This scenario I can still handle by updating all the users outside the server's local time, but once I've moved forward/backward the time of all the other users, I still need a way to detect when (time and date) the users living outside the UK will (or will not) change their local time to a probable DST one.

I need a PHP method to know/detect when other parts of the world will enter/exit DST.

As I do already use the strtotime on several places in my code, I think your answer is the best one, even if I still have a lot to do in particular integrating this into my crontab job (I'll use the TZ= tag). Cheers
–
NicolasJun 1 '11 at 11:23

3

this wont work if time specified is in DST especially when it goes -1.
–
ParhsMay 14 '12 at 14:25

As Jimmy points out you can use timezone transitions, but this is not available on PHP <5.3. as dateTimeZone() is PHP>=5.2.2 but getTransitions() with arguments is not! In that case here is a function that can give you timezone data, including whether in DST or not.

So here, all we need to do is pass in the timezone we want to check and we can know if that timezone is in DST/what the offset is. You'll then need to check the offset against GMT to see if you want to send your e-mail now, or not now.