I'm pulling the raw generated mysql timestamp info of $item_date from the database as php date format:
if (($timestamp = strtotime($item_date)) === false) {
echo "The timestamp string is bogus";
} else {
echo date('j M Y h:i:sA', $timestamp);
}
Output folowwing the server zone (UTC):
12 Nov 2012 05:54:11PM
but i want it to convert according to the user time zone
Example: let's say if the user's time is 13 Nov 2012 07:00:00 AM(+0800 GMT) and the server time is 12 Nov 2012 11:00:00 PM(UTC) and the timestamp of $item_date is 12 Nov 2012 10:30:00 PM (UTC) so
User with (UTC) will see $item_date as:
12 Nov 2012 10:30:00 PM
and user with (+0800 GMT) will see $item_date as:
13 Nov 2012 06:30:00 PM
How do i get it done? Thanks