eruna — 2011-11-10T10:29:54-05:00 — #1
I'm importing dates that are in UTC format. Is there an easy way to convert this to EST? Daylight savings is the hitch. It doesn't switch the same date every year, so it seems like figuring the offset based on the date would be tricky.
Does anyone have any ideas or suggestions?
salathe — 2011-11-10T15:29:22-05:00 — #2
DateTime (documentation) class makes working with timezones easy.
$date = new DateTime('2011-11-10 20:17:23', new DateTimeZone('UTC'));
echo $date->format('Y-m-d H:i:s O'); // 2011-11-10 15:17:23 -0500
eruna — 2011-11-10T23:15:06-05:00 — #3
Thank you! Brilliant.