WordPress.org

Make WordPress Core

Ticket #28636: functions.2.diff

File functions.2.diff, 665 bytes (added by gravityview, 13 months ago)

Fixes issue where passing $timestamp_with_offset as 0 is interpreted as the current datetime, instead of unix epoch for both GMT *and* non-GMT (see comment #34)

  • functions.php

     
    176176         */
    177177        if ( 'U' === $format ) {
    178178                $date = $timestamp;
    179         } elseif ( $gmt && ! $timestamp_with_offset ) { // Current time in UTC.
     179        } elseif ( $gmt && false === $timestamp_with_offset ) { // Current time in UTC.
    180180                $date = wp_date( $format, null, new DateTimeZone( 'UTC' ) );
    181         } elseif ( ! $timestamp_with_offset ) { // Current time in site's timezone.
     181        } elseif ( false === $timestamp_with_offset ) { // Current time in site's timezone.
    182182                $date = wp_date( $format );
    183183        } else {
    184184                /*