mysql - Calculate the right moment with timezones -


i have user table timezone (example: america/bogota) , timezone offset (example: -25200).

we have webserver in germany (europe/berlin) , want send emails on right moment when user in usa, africa or asia has 6am.

i getting offset following php code , insert in user-table.

function delta_offset( $server_timezone, $user_timezone )     {         $dt = new datetime('now', new datetimezone($server_timezone));         $offset_server = $dt->getoffset();         $dt->settimezone(new datetimezone($user_timezone));         $offset_user = $dt->getoffset();         return $offset_user - $offset_server;     }   $server_tz = "utc";  $user_tz = $this->input->post( 'timezone' );  $offset = delta_offset( $server_tz, $user_tz ); 

it seems works "get timezone , offset"-thing, dont know how query components in 1 query user-items.

can give me or hint solve that?


Popular posts from this blog

php - How should I create my API for mobile applications (Needs Authentication) -

5 Reasons to Blog Anonymously (and 5 Reasons Not To)

Google AdWords and AdSense - A Dynamic Small Business Marketing Duo