How to convert timestamp to "this date"?

I have timestamp, and I need it to be translated by PHP into following string: 2008-07-17T09:24:17Z. It’s for plugin. I know the y-m-d. But there’s also T and Z for no reason. The question being, how could I translate timestamp into date same as above?

$timestamp = 1485620679;
// magic
echo $date;
$date = gmdate('Y-m-d\TH:i:s\Z', $timestamp);
2 Likes

"The T is just a literal to separate the date from the time, and the Z means “zero hour offset” also known as “Zulu time” (UTC). " : http://stackoverflow.com/questions/8405087/what-is-this-date-format-2011-08-12t201746-384z

2 Likes

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.