Jump to content

Recommended Posts

I have a requirement where by i have to find out the local date and time of the place i have searched.

E.g i have searched Hawii, USA. I need to know how to find date and time of this place.

 

I have tried using timezones function in php but it is working only for a few places. Also tried

<?

$city["Name"] = "Hawii, United States ";

$city["GMT"] = 10;

$city_time = time()+($city["GMT"]*3600); //sum the timestamps

echo gmdate("m-d-Y h:i a",$city_time); //echo the formatted date

echo "  in the beautiful city of ".$city["Name"];

?>

This gives me incorrect value.

 

FYI i have GMT values and Latitude-Longitude values for each city/state.

Can anyone help me how to solve my problem asap.

 

Thanks in advance.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.