Created
July 17, 2012 13:59
-
-
Save ericandrewlewis/3129529 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Accepts a UTC timestamp and outputs the Badgestack desired formatting | |
// in the locally set timezone based on the WP settting | |
function get_timestamp_locally_modified($timestamp) { | |
$date = new DateTime($timestamp, new DateTimeZone('UTC')); | |
date_timezone_set( $date, new DateTimeZone( get_option('timezone_string') ) ); | |
$timestamp = $date->format( 'F j, Y \a\t h:ia' ); | |
return $timestamp; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment