Using PHP, I want to convert UNIX timestamps to date strings similar to this: 2008-07-17T09:24:17Z
How do I convert a timestamp such as 1333699439
to 2008-07-17T09:24:17Z
?
Advertisement
Answer
Try gmdate
like this:
JavaScript
x
<?php
$timestamp=1333699439;
echo gmdate("Y-m-dTH:i:sZ", $timestamp);
?>