WordPress.org

Make WordPress Core

Changes between Version 7 and Version 8 of Ticket #41782, comment 8


Ignore:
Timestamp:
09/03/2017 04:52:10 PM (3 years ago)
Author:
birgire
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #41782, comment 8

    v7 v8  
    2828        printf( "date( 'Y-m-d H:i:s', strtotime( \$datetime ) ): %s"            . PHP_EOL, date( 'Y-m-d H:i:s', strtotime( $datetime ) ) );
    2929        printf( "date( 'Y-m-d H:i:s', strtotime( \$datetime, \$now ) ): %s"     . PHP_EOL, date( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ) );
     30        printf( "gmdate( 'Y-m-d H:i:s', strtotime( \$datetime ) ): %s"  . PHP_EOL, gmdate( 'Y-m-d H:i:s', strtotime( $datetime ) ) );
    3031        printf( "gmdate( 'Y-m-d H:i:s', strtotime( \$datetime, \$now ) ): %s"   . PHP_EOL, gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ) );
    3132}
     
    5051date_default_timezone_get(): UTC
    5152$gmt_offset: 0
    52 time(): 1504456206
    53 $now = time() + $gm_offset * 3600: 1504456206
     53time(): 1504457440
     54$now = time() + $gm_offset * 3600: 1504457440
    5455strtotime( $datetime ): 1483264800
    5556strtotime( $datetime, $now ): 1483264800
    5657date( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-01-01 10:00:00
    5758date( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-01-01 10:00:00
     59gmdate( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-01-01 10:00:00
    5860gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-01-01 10:00:00
    5961
     
    6163date_default_timezone_get(): UTC
    6264$gmt_offset: 1
    63 time(): 1504456206
    64 $now = time() + $gm_offset * 3600: 1504459806
     65time(): 1504457440
     66$now = time() + $gm_offset * 3600: 1504461040
    6567strtotime( $datetime ): 1483264800
    6668strtotime( $datetime, $now ): 1483264800
    6769date( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-01-01 10:00:00
    6870date( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-01-01 10:00:00
     71gmdate( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-01-01 10:00:00
    6972gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-01-01 10:00:00
    7073
     
    7275date_default_timezone_get(): UTC
    7376$gmt_offset: 2
    74 time(): 1504456206
    75 $now = time() + $gm_offset * 3600: 1504463406
     77time(): 1504457440
     78$now = time() + $gm_offset * 3600: 1504464640
    7679strtotime( $datetime ): 1483264800
    7780strtotime( $datetime, $now ): 1483264800
    7881date( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-01-01 10:00:00
    7982date( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-01-01 10:00:00
     83gmdate( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-01-01 10:00:00
    8084gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-01-01 10:00:00
    8185}}}
     
    98102date_default_timezone_get(): UTC
    99103$gmt_offset: 0
    100 time(): 1504456206
    101 $now = time() + $gm_offset * 3600: 1504456206
    102 strtotime( $datetime ): 1504197006
    103 strtotime( $datetime, $now ): 1504197006
    104 date( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-08-31 16:30:06
    105 date( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 16:30:06
    106 gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 16:30:06
     104time(): 1504457440
     105$now = time() + $gm_offset * 3600: 1504457440
     106strtotime( $datetime ): 1504198240
     107strtotime( $datetime, $now ): 1504198240
     108date( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-08-31 16:50:40
     109date( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 16:50:40
     110gmdate( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-08-31 16:50:40
     111gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 16:50:40
    107112
    108113$datetime: -3 days
    109114date_default_timezone_get(): UTC
    110115$gmt_offset: 1
    111 time(): 1504456206
    112 $now = time() + $gm_offset * 3600: 1504459806
    113 strtotime( $datetime ): 1504197006
    114 strtotime( $datetime, $now ): 1504200606
    115 date( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-08-31 16:30:06
    116 date( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 17:30:06
    117 gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 17:30:06
     116time(): 1504457440
     117$now = time() + $gm_offset * 3600: 1504461040
     118strtotime( $datetime ): 1504198240
     119strtotime( $datetime, $now ): 1504201840
     120date( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-08-31 16:50:40
     121date( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 17:50:40
     122gmdate( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-08-31 16:50:40
     123gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 17:50:40
    118124
    119125$datetime: -3 days
    120126date_default_timezone_get(): UTC
    121127$gmt_offset: 2
    122 time(): 1504456206
    123 $now = time() + $gm_offset * 3600: 1504463406
    124 strtotime( $datetime ): 1504197006
    125 strtotime( $datetime, $now ): 1504204206
    126 date( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-08-31 16:30:06
    127 date( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 18:30:06
    128 gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 18:30:06
     128time(): 1504457440
     129$now = time() + $gm_offset * 3600: 1504464640
     130strtotime( $datetime ): 1504198240
     131strtotime( $datetime, $now ): 1504205440
     132date( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-08-31 16:50:40
     133date( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 18:50:40
     134gmdate( 'Y-m-d H:i:s', strtotime( $datetime ) ): 2017-08-31 16:50:40
     135gmdate( 'Y-m-d H:i:s', strtotime( $datetime, $now ) ): 2017-08-31 18:50:40
    129136}}}
    130137