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 Link to comment https://forums.phpfreaks.com/topic/199350-time-zone-problem/ 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"); Link to comment https://forums.phpfreaks.com/topic/199350-time-zone-problem/#findComment-1046269 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 Link to comment https://forums.phpfreaks.com/topic/199350-time-zone-problem/#findComment-1046273 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.