everurssantosh Posted July 10, 2008 Share Posted July 10, 2008 Hi, I need to find out the local time of a place whose address is given to me. For example : I am having the address like Columbus, OHIO, USA. I need to find the local time at Columbus. This I need in PHP. Kindly help me to get this thing done. Is there any Function that PHP offers directly from where we can calculate the time from the address or we need to write something customized to get it done. Any help in this regard is highly appreciated Thank you Quote Link to comment https://forums.phpfreaks.com/topic/114106-retrieve-local-time-from-the-address-php-help/ Share on other sites More sharing options...
discomatt Posted July 10, 2008 Share Posted July 10, 2008 Very custom. You need to reverse geocode the address into a lat,long pair, then find out what time zone that position is in. You then have to compare the timezone your server is in with the calculated one, and adjust the time accordingly. Quote Link to comment https://forums.phpfreaks.com/topic/114106-retrieve-local-time-from-the-address-php-help/#findComment-586473 Share on other sites More sharing options...
.josh Posted July 10, 2008 Share Posted July 10, 2008 There is no built-in php function for this. You can go the route of trying to compile a list of timezones for every location, or you can simply make a dropdown and allow the user to pick their own timezone. You could possibly find a website that already has all that work done for you and you could possibly use curl to send/get the results, but that makes your script dependent on someone else's. Most people opt for option #2. Quote Link to comment https://forums.phpfreaks.com/topic/114106-retrieve-local-time-from-the-address-php-help/#findComment-586480 Share on other sites More sharing options...
everurssantosh Posted July 10, 2008 Author Share Posted July 10, 2008 Thank You .... Quote Link to comment https://forums.phpfreaks.com/topic/114106-retrieve-local-time-from-the-address-php-help/#findComment-586600 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.