我怎样才能确保我在某个时间在PHP中发生某些事情,并且它发生在每个人的时区?

i have read many different sites and many different solutions that deal with timezones and server times and client/user local time, etc., but no one explains in detail this exact situation i'm trying to accomplish.

i have this php code that makes something expire at a certain date and time, and it works great, but it only makes the content expire at the server's time. i want it to expire on all time zones when that time comes for that time zone. i don't want the content to expire at the same time for all time zones.

so let's say i want something to expire at 2pm, the very first timezone that hits 2pm they shouldn't be able to see the expired content, but the rest of the time zones should still be able to see it. then when the 2nd timezone hits 2pm, that timezone shouldn't see the content. so now 2 timezones can't see the content but the rest of the time zones should still see it. and this continues one timezone at a time until all the timezones have hit 2pm.

please tell me how to adjust this php to make the above happen.

<?php
$end_date = strtotime('02:00pm April 1, 2012');
$now = time();
if ($end_date < $now) {
?>
different content to display after date and time has arrived,
or don't put anything here if you just want expired content to disappear
and nothing else to take it's place.
<?php } else { ?>
content to display while the date and time hasn't arrived yet.
<?php } ?>

What you require is a <select>User please select your timezone</select> (all the way until +12 <> -12, and that option should select EVERY user which lands on your site - including you - for something like that to happen.

Server have no idea per IP - which user is in which zone, unless you work it out somehow.

You should work with GMT time, and develop special function for handling user (timezone) inputs for that to happen.