I've got a WordPress cron job that sends an email periodically and saves the timestamp when it was sent as an option, and I'd like to display a date on a settings page. Something like, "The last email was sent on 'x'". I'm on the west coast of the US, so our time is currently seven hours off of UTC.
My expected output from date_i18n(), passing it the timestamp, would be a locally formatted date with a seven hour adjustment from UTC. However, it returns the time in UTC. Even trying to get the current time doesn't return what I would think would be the expected output.
echo date_i18n('F d, Y H:i'); outputs April 05, 2013 11:36 as expected, but
echo date_i18n('F d, Y H:i',time()); outputs April 05, 2013 18:36.
Is this intentional? How can I return a locally formatted date from a preexisting time stamp? Thanks for any help.