I am attempting to display a datetime from my MySQL database being an iso 8601 formated string with PHP but it is being released wrong.

17 March 2008 is being released as: 1969-12-31T18:33:28-06:00 that is clearly not correct (the entire year ought to be 2008 not 1969)

This is actually the code I am using:

<?= date("c", $publish[3]) ?>

$publish[3] may be the datetime (CURRENT_TIMESTAMP) from my MySQL database.

Any ideas what is going on wrong?

The 2nd argument of date is really a UNIX timestamp, not really a database timestamp string.

You have to convert your database timestamp with strtotime.

<?= date("c", strtotime($publish[3])) ?>

For pre PHP 5:

function iso8601($time=false) 

This is actually the good function for pre PHP 5: I added GMT difference in the finish, it isn't hardcoded.

function iso8601($time=false)