Skip to content

Instantly share code, notes, and snippets.

@sokil
Last active August 29, 2015 14:01
Show Gist options
  • Save sokil/ed429b43a305b5432f3e to your computer and use it in GitHub Desktop.
Save sokil/ed429b43a305b5432f3e to your computer and use it in GitHub Desktop.
<?php
/**
* @link http://www.w3.org/Protocols/rfc2616/rfc2616-sec3.html#sec3.3.1
*/
function timestampToHttpDate($timestamp) {
return gmdate('D, d M Y H:i:s', $timestamp) . ' GMT';
}
@sokil
Copy link
Author

sokil commented May 21, 2014

echo timestampToHttpDate(time());
Wed, 21 May 2014 12:26:11 GMT

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment