Skip to content
This repository has been archived by the owner on Aug 12, 2020. It is now read-only.

Commit

Permalink
Made default create timezone always explicit to ease up on conditionals.
Browse files Browse the repository at this point in the history
  • Loading branch information
Rarst committed Nov 17, 2016
1 parent a9006ed commit 5412fc7
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions php/WpDateTimeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,7 @@ public static function createFromPost( $post, $field = 'date' ) {
$post_date = get_post_field( "post_{$field}_gmt", $post );

$wp_timezone = WpDateTimeZone::getWpTimezone();
$create_timezone = null;

// Something switched default timezone.
if ( 'UTC' !== date_default_timezone_get() ) {
$create_timezone = new \DateTimeZone( 'UTC' );
}
$create_timezone = new \DateTimeZone( 'UTC' );

// Missing GMT data, fall back to usual field and assume WP timezone.
if ( empty( $post_date ) ) {
Expand Down

0 comments on commit 5412fc7

Please sign in to comment.