I pull the raw generated mysql timestamp information from $ item_date from the database in php date format:
if (($timestamp = strtotime($item_date)) === false) { echo "The timestamp string is bogus"; } else { echo date('j MY h:i:sA', $timestamp); }
Exit Server Zone (UTC):
12 Nov 2012 05:54:11 PM
but I want it to be converted according to the user's time zone
Example: let's say if the user time is November 13, 2012 07:00:00 (+0800 GMT) , and the server time is November 12, 2012 11:00:00 (UTC) and the timestamp is $ item_date November 12, 2012 10:30 : 00 (UTC) , therefore
A user with (UTC) will see $ item_date as:
November 12, 2012 10:30:00 PM
and user with (+0800 GMT) will see $ item_date as:
November 13, 2012 18:30:00
How can I do it? Thanks
Jeremy john
source share