dst - PHP daylight saving time detection -
i need send email users based wherever in world @ 9:00 local time. server in uk. can set time difference between each user , server's time, work if dst didn't exist.
here's example illustrate it:
- john works in new york, -5 hours server (uk) time
- richard works in london, uk, 0 hour difference server.
when server goes gmt gmt +1 (bst) @ 2:00am on sunday, means john has -6h time difference now.
this scenario can still handle updating users outside server's local time, once i've moved forward/backward time of other users, still need way detect when (time , date) users living outside uk (or not) change local time probable dst one.
i need php method know/detect when other parts of world enter/exit dst.
do need know details of dst transition yourself? or need know when 9:00 in given timezone?
if it's latter, php can use operating system's timezone database you. strtotime() function remarkably @ "figuring out" mean:
echo strtotime("today 9:00 america/new_york"); // prints "1306501200" echo strtotime("today 9:00 europe/london"); // prints "1306483200"
just make sure you're using 1 of php supported timezones.
Comments
Post a Comment