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) {
This post has been updated to include a full-fledged example
setTimestamp($item_date);
//just for the fun: what would it be in UTC?
$dt->setTimezone(new DateTimeZone("UTC"));
$would_be = $dt->format('Y-m-d H:i:sP');
$dt->setTimezone(new DateTimeZone($_SESSION['tz']));
$is = $dt->format('Y-m-d H:i:sP');
echo "Timestamp " . $item_date . " is date " . $is .
" in users timezone " . $dt->getTimezone()->getName() .
" and would be " . $would_be . " in UTC
";
}
?>
I hope this is now clear enough ;).