cherankrish Posted April 22, 2010 Share Posted April 22, 2010 Hi need some help.have a iphone interface to schedule sms.my php scripts generate sms.people who are purchase this iphone app from different part of the world schedule sms.how can i generate sms to the correct time? iphone app should pass the timezone parameter to my php app? any idea?please help Quote Link to comment Share on other sites More sharing options...
joel24 Posted April 22, 2010 Share Posted April 22, 2010 have the users fill choose their timezone, i.e. have a select box with +1 +2 etc, or the list of timezones, Sydney/Australia New York/USA etc. then have their information/timezone stored in a database, and when they login you can have a code liek //timezone php putenv('TZ=Australia/Sydney'); and if you want to change the mysql timezone also, //get offset, including daylight savings because mysql won't! $currentOffset = "+".(date("Z") / 60 / 60).":00"; //timezone mysql $update_tz = @mysql_query("SET time_zone = '$currentOffset'") or die(mysql_error()); so for that use the timezone would be australia/sydney and it would be stored in the database with their user details, and then when they log in that information would be retrieved from the database and the line //timezone php $sql = @mysql_query("SELECT timezone FROM users WHERE userid = 'whatever'"); $userDetails = mysql_fetch_array($sql); $timezone = $userDetails['timezone']; putenv("TZ=$timezone"); Quote Link to comment Share on other sites More sharing options...
cherankrish Posted April 22, 2010 Author Share Posted April 22, 2010 Thanks for the help joel.let me give a try and get back to you Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.