I am writing a program in php.
Normally we use set_default_timzone()
to set the time zone .
I have details of many users in my database and based on that i am trying to select the time zone for the user like
If user has chosen GMT + 5.30 at the time of registration ,I wanted to set default time zone as ('Asia/Kolkata')
for his profile page
So i am looking for a way so that i could set the time zone for user based on the time zone whatever he had provided .
I am adding some more text Here
I have data like GMT + 5.30
in my db based on this i wanted to set the time zone like
if (timezone == "GMT + 5.30 "){
set_default_timezone('Asia/Kolkata');
}
Above code is logic only
Another one
$offset = -5;
$timezone = getTimeZone($offset); //return America/New_York