Jump to content

date & time with time zone


starphp

Recommended Posts

Hello,

 

I have stored date & time in the MySql database  using the data type (DATETIME). I wish to display the date time in EST time zone.

 

How can I achieve this ? I have tried to change the TimeZone using the php function:

date_default_timezone_set("EST");

 

But it doesn't work.

 

I have modified the date format by using the code:

 

date("M j", strtotime($data['received_time']) )." at ".date("g:ia", strtotime($data['received_time']) )

 

to display the time as May 6 at 10:10am

 

Is this correct ?

 

Actually I am trying to display time in User's Time Zone. If no time zone is present, then it will be displayed in EST format. And for that I stored date & time in MySql and did the steps.

 

Also, is it possible to find the TimeZone of user during registration process without a TimeZone selection menu ?

 

Any suggestions would be great.

 

Thank You.

 

 

Link to comment
https://forums.phpfreaks.com/topic/157059-date-time-with-time-zone/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.