Skip to content

Instantly share code, notes, and snippets.



Created Dec 18, 2017
What would you like to do?
Converting to and from UTC and Unix time
// Convert UTC time string to Unix time interger.
$timestamp = strtotime ( '2014-12-29 12:30:21+0000' );
// Convert Unix time integer back to UTC time string.
echo gmdate(DateTime::ISO8601, $timestamp);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment