Make WordPress Core


Ignore:
Timestamp:
05/26/2019 12:11:37 AM (7 years ago)
Author:
SergeyBiryukov
Message:

Date/Time: Replace all instances of date() with gmdate().

Use of date() in core depends on PHP timezone set to UTC and not changed by third party code (which cannot be guaranteed).

gmdate() is functionally equivalent, but is not affected by PHP timezone setting: it's always UTC, which is the exact behavior the core needs.

Props nielsdeblaauw, Rarst.
Fixes #46438. See #44491.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/comment/commentsTemplate.php

    r44659 r45424  
    1818                                'comment_post_ID'  => $p,
    1919                                'comment_content'  => '1',
    20                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    21                         )
    22                 );
    23                 $comment_2 = self::factory()->comment->create(
    24                         array(
    25                                 'comment_post_ID'  => $p,
    26                                 'comment_content'  => '2',
    27                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
     20                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     21                        )
     22                );
     23                $comment_2 = self::factory()->comment->create(
     24                        array(
     25                                'comment_post_ID'  => $p,
     26                                'comment_content'  => '2',
     27                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
    2828                        )
    2929                );
    … …  
    5252                                'comment_post_ID'  => $p,
    5353                                'comment_content'  => '1',
    54                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    55                         )
    56                 );
    57                 $comment_2 = self::factory()->comment->create(
    58                         array(
    59                                 'comment_post_ID'  => $p,
    60                                 'comment_content'  => '2',
    61                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
     54                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     55                        )
     56                );
     57                $comment_2 = self::factory()->comment->create(
     58                        array(
     59                                'comment_post_ID'  => $p,
     60                                'comment_content'  => '2',
     61                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
    6262                        )
    6363                );
    … …  
    8686                                'comment_post_ID'  => $p,
    8787                                'comment_content'  => '1',
    88                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    89                         )
    90                 );
    91                 $comment_2 = self::factory()->comment->create(
    92                         array(
    93                                 'comment_post_ID'  => $p,
    94                                 'comment_content'  => '2',
    95                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
     88                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     89                        )
     90                );
     91                $comment_2 = self::factory()->comment->create(
     92                        array(
     93                                'comment_post_ID'  => $p,
     94                                'comment_content'  => '2',
     95                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
    9696                        )
    9797                );
    … …  
    120120                                'comment_post_ID'  => $p,
    121121                                'comment_content'  => '1',
    122                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    123                         )
    124                 );
    125                 $comment_2 = self::factory()->comment->create(
    126                         array(
    127                                 'comment_post_ID'  => $p,
    128                                 'comment_content'  => '2',
    129                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
     122                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     123                        )
     124                );
     125                $comment_2 = self::factory()->comment->create(
     126                        array(
     127                                'comment_post_ID'  => $p,
     128                                'comment_content'  => '2',
     129                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
    130130                        )
    131131                );
    … …  
    154154                                'comment_post_ID'  => $p,
    155155                                'comment_content'  => '1',
    156                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    157                         )
    158                 );
    159                 $comment_2 = self::factory()->comment->create(
    160                         array(
    161                                 'comment_post_ID'  => $p,
    162                                 'comment_content'  => '2',
    163                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
    164                         )
    165                 );
    166                 $comment_3 = self::factory()->comment->create(
    167                         array(
    168                                 'comment_post_ID'  => $p,
    169                                 'comment_content'  => '3',
    170                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     156                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     157                        )
     158                );
     159                $comment_2 = self::factory()->comment->create(
     160                        array(
     161                                'comment_post_ID'  => $p,
     162                                'comment_content'  => '2',
     163                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
     164                        )
     165                );
     166                $comment_3 = self::factory()->comment->create(
     167                        array(
     168                                'comment_post_ID'  => $p,
     169                                'comment_content'  => '3',
     170                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    171171                        )
    172172                );
    … …  
    175175                                'comment_post_ID'  => $p,
    176176                                'comment_content'  => '4',
    177                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ),
     177                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 400 ),
    178178                        )
    179179                );
    … …  
    182182                                'comment_post_ID'  => $p,
    183183                                'comment_content'  => '3',
    184                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 500 ),
     184                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 500 ),
    185185                        )
    186186                );
    … …  
    189189                                'comment_post_ID'  => $p,
    190190                                'comment_content'  => '4',
    191                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 600 ),
     191                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 600 ),
    192192                        )
    193193                );
    … …  
    225225                                'comment_post_ID'  => $p,
    226226                                'comment_content'  => '1',
    227                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    228                         )
    229                 );
    230                 $comment_2 = self::factory()->comment->create(
    231                         array(
    232                                 'comment_post_ID'  => $p,
    233                                 'comment_content'  => '2',
    234                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
    235                         )
    236                 );
    237                 $comment_3 = self::factory()->comment->create(
    238                         array(
    239                                 'comment_post_ID'  => $p,
    240                                 'comment_content'  => '3',
    241                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     227                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     228                        )
     229                );
     230                $comment_2 = self::factory()->comment->create(
     231                        array(
     232                                'comment_post_ID'  => $p,
     233                                'comment_content'  => '2',
     234                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
     235                        )
     236                );
     237                $comment_3 = self::factory()->comment->create(
     238                        array(
     239                                'comment_post_ID'  => $p,
     240                                'comment_content'  => '3',
     241                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    242242                        )
    243243                );
    … …  
    246246                                'comment_post_ID'  => $p,
    247247                                'comment_content'  => '4',
    248                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ),
     248                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 400 ),
    249249                        )
    250250                );
    … …  
    253253                                'comment_post_ID'  => $p,
    254254                                'comment_content'  => '3',
    255                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 500 ),
     255                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 500 ),
    256256                        )
    257257                );
    … …  
    260260                                'comment_post_ID'  => $p,
    261261                                'comment_content'  => '4',
    262                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 600 ),
     262                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 600 ),
    263263                        )
    264264                );
    … …  
    296296                                'comment_post_ID'  => $p,
    297297                                'comment_content'  => '1',
    298                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    299                         )
    300                 );
    301                 $comment_2 = self::factory()->comment->create(
    302                         array(
    303                                 'comment_post_ID'  => $p,
    304                                 'comment_content'  => '2',
    305                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
    306                         )
    307                 );
    308                 $comment_3 = self::factory()->comment->create(
    309                         array(
    310                                 'comment_post_ID'  => $p,
    311                                 'comment_content'  => '3',
    312                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     298                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     299                        )
     300                );
     301                $comment_2 = self::factory()->comment->create(
     302                        array(
     303                                'comment_post_ID'  => $p,
     304                                'comment_content'  => '2',
     305                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
     306                        )
     307                );
     308                $comment_3 = self::factory()->comment->create(
     309                        array(
     310                                'comment_post_ID'  => $p,
     311                                'comment_content'  => '3',
     312                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    313313                        )
    314314                );
    … …  
    317317                                'comment_post_ID'  => $p,
    318318                                'comment_content'  => '4',
    319                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ),
     319                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 400 ),
    320320                        )
    321321                );
    … …  
    353353                                'comment_post_ID'  => $p,
    354354                                'comment_content'  => '1',
    355                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    356                         )
    357                 );
    358                 $comment_2 = self::factory()->comment->create(
    359                         array(
    360                                 'comment_post_ID'  => $p,
    361                                 'comment_content'  => '2',
    362                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
    363                         )
    364                 );
    365                 $comment_3 = self::factory()->comment->create(
    366                         array(
    367                                 'comment_post_ID'  => $p,
    368                                 'comment_content'  => '3',
    369                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     355                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     356                        )
     357                );
     358                $comment_2 = self::factory()->comment->create(
     359                        array(
     360                                'comment_post_ID'  => $p,
     361                                'comment_content'  => '2',
     362                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
     363                        )
     364                );
     365                $comment_3 = self::factory()->comment->create(
     366                        array(
     367                                'comment_post_ID'  => $p,
     368                                'comment_content'  => '3',
     369                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    370370                        )
    371371                );
    … …  
    374374                                'comment_post_ID'  => $p,
    375375                                'comment_content'  => '4',
    376                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ),
     376                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 400 ),
    377377                        )
    378378                );
    … …  
    412412                                'comment_post_ID'  => $p,
    413413                                'comment_content'  => '1',
    414                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    415                         )
    416                 );
    417                 $comment_2 = self::factory()->comment->create(
    418                         array(
    419                                 'comment_post_ID'  => $p,
    420                                 'comment_content'  => '2',
    421                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
    422                         )
    423                 );
    424                 $comment_3 = self::factory()->comment->create(
    425                         array(
    426                                 'comment_post_ID'  => $p,
    427                                 'comment_content'  => '3',
    428                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     414                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     415                        )
     416                );
     417                $comment_2 = self::factory()->comment->create(
     418                        array(
     419                                'comment_post_ID'  => $p,
     420                                'comment_content'  => '2',
     421                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
     422                        )
     423                );
     424                $comment_3 = self::factory()->comment->create(
     425                        array(
     426                                'comment_post_ID'  => $p,
     427                                'comment_content'  => '3',
     428                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    429429                        )
    430430                );
    … …  
    464464                                'comment_post_ID'  => $p,
    465465                                'comment_content'  => '1',
    466                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    467                         )
    468                 );
    469                 $comment_2 = self::factory()->comment->create(
    470                         array(
    471                                 'comment_post_ID'  => $p,
    472                                 'comment_content'  => '2',
    473                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
    474                         )
    475                 );
    476                 $comment_3 = self::factory()->comment->create(
    477                         array(
    478                                 'comment_post_ID'  => $p,
    479                                 'comment_content'  => '3',
    480                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     466                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     467                        )
     468                );
     469                $comment_2 = self::factory()->comment->create(
     470                        array(
     471                                'comment_post_ID'  => $p,
     472                                'comment_content'  => '2',
     473                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
     474                        )
     475                );
     476                $comment_3 = self::factory()->comment->create(
     477                        array(
     478                                'comment_post_ID'  => $p,
     479                                'comment_content'  => '3',
     480                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    481481                        )
    482482                );
    … …  
    514514                                'comment_post_ID'  => $p,
    515515                                'comment_content'  => '1',
    516                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    517                         )
    518                 );
    519                 $comment_2 = self::factory()->comment->create(
    520                         array(
    521                                 'comment_post_ID'  => $p,
    522                                 'comment_content'  => '2',
    523                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
    524                         )
    525                 );
    526                 $comment_3 = self::factory()->comment->create(
    527                         array(
    528                                 'comment_post_ID'  => $p,
    529                                 'comment_content'  => '3',
    530                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     516                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     517                        )
     518                );
     519                $comment_2 = self::factory()->comment->create(
     520                        array(
     521                                'comment_post_ID'  => $p,
     522                                'comment_content'  => '2',
     523                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
     524                        )
     525                );
     526                $comment_3 = self::factory()->comment->create(
     527                        array(
     528                                'comment_post_ID'  => $p,
     529                                'comment_content'  => '3',
     530                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    531531                        )
    532532                );
    … …  
    535535                                'comment_post_ID'  => $p,
    536536                                'comment_content'  => '4',
    537                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ),
     537                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 400 ),
    538538                        )
    539539                );
    … …  
    593593                                'comment_post_ID'  => $p,
    594594                                'comment_content'  => '1',
    595                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
    596                         )
    597                 );
    598                 $comment_2 = self::factory()->comment->create(
    599                         array(
    600                                 'comment_post_ID'  => $p,
    601                                 'comment_content'  => '2',
    602                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
    603                         )
    604                 );
    605                 $comment_3 = self::factory()->comment->create(
    606                         array(
    607                                 'comment_post_ID'  => $p,
    608                                 'comment_content'  => '3',
    609                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     595                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
     596                        )
     597                );
     598                $comment_2 = self::factory()->comment->create(
     599                        array(
     600                                'comment_post_ID'  => $p,
     601                                'comment_content'  => '2',
     602                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
     603                        )
     604                );
     605                $comment_3 = self::factory()->comment->create(
     606                        array(
     607                                'comment_post_ID'  => $p,
     608                                'comment_content'  => '3',
     609                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    610610                        )
    611611                );
    … …  
    614614                                'comment_post_ID'  => $p,
    615615                                'comment_content'  => '4',
    616                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ),
     616                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 400 ),
    617617                        )
    618618                );
    … …  
    621621                                'comment_post_ID'  => $p,
    622622                                'comment_content'  => '4',
    623                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 500 ),
     623                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 500 ),
    624624                        )
    625625                );
    … …  
    628628                                'comment_post_ID'  => $p,
    629629                                'comment_content'  => '4',
    630                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 600 ),
     630                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 600 ),
    631631                        )
    632632                );
    … …  
    707707                                'comment_content'  => '1',
    708708                                'comment_approved' => '0',
    709                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
     709                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
    710710                        )
    711711                );
    … …  
    715715                                'comment_content'  => '2',
    716716                                'comment_approved' => '0',
    717                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
     717                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
    718718                        )
    719719                );
    … …  
    723723                                'comment_content'  => '3',
    724724                                'comment_approved' => '0',
    725                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     725                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    726726                        )
    727727                );
    … …  
    731731                                'comment_content'  => '4',
    732732                                'comment_approved' => '1',
    733                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ),
     733                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 400 ),
    734734                        )
    735735                );
    … …  
    763763                                'comment_content'  => '1',
    764764                                'comment_approved' => '0',
    765                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
     765                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
    766766                        )
    767767                );
    … …  
    771771                                'comment_content'  => '2',
    772772                                'comment_approved' => '0',
    773                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
     773                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
    774774                        )
    775775                );
    … …  
    779779                                'comment_content'      => '3',
    780780                                'comment_approved'     => '0',
    781                                 'comment_date_gmt'     => date( 'Y-m-d H:i:s', $now - 100 ),
     781                                'comment_date_gmt'     => gmdate( 'Y-m-d H:i:s', $now - 100 ),
    782782                                'comment_author_email' => $comment_author_email,
    783783                        )
    … …  
    788788                                'comment_content'      => '4',
    789789                                'comment_approved'     => '0',
    790                                 'comment_date_gmt'     => date( 'Y-m-d H:i:s', $now - 200 ),
     790                                'comment_date_gmt'     => gmdate( 'Y-m-d H:i:s', $now - 200 ),
    791791                                'comment_author_email' => $comment_author_email,
    792792                        )
    … …  
    797797                                'comment_content'      => '5',
    798798                                'comment_approved'     => '0',
    799                                 'comment_date_gmt'     => date( 'Y-m-d H:i:s', $now - 300 ),
     799                                'comment_date_gmt'     => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    800800                                'comment_author_email' => $comment_author_email,
    801801                        )
    … …  
    806806                                'comment_content'  => '6',
    807807                                'comment_approved' => '1',
    808                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 400 ),
     808                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 400 ),
    809809                        )
    810810                );
    … …  
    843843                                'comment_content'      => '1',
    844844                                'comment_approved'     => '0',
    845                                 'comment_date_gmt'     => date( 'Y-m-d H:i:s', $now ),
     845                                'comment_date_gmt'     => gmdate( 'Y-m-d H:i:s', $now ),
    846846                                'comment_author_email' => 'foo@bar.mail',
    847847                        )
    … …  
    879879                                'comment_content'  => '1',
    880880                                'comment_approved' => '1',
    881                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
     881                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
    882882                        )
    883883                );
    … …  
    887887                                'comment_content'  => '2',
    888888                                'comment_approved' => '1',
    889                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     889                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    890890                        )
    891891                );
    … …  
    896896                                'comment_approved' => '1',
    897897                                'comment_parent'   => $comment_1,
    898                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
     898                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
    899899                        )
    900900                );
    … …  
    924924                                'comment_content'  => '1',
    925925                                'comment_approved' => '1',
    926                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 300 ),
     926                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 300 ),
    927927                        )
    928928                );
    … …  
    932932                                'comment_content'  => '2',
    933933                                'comment_approved' => '1',
    934                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 200 ),
     934                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 200 ),
    935935                        )
    936936                );
    … …  
    941941                                'comment_approved' => '1',
    942942                                'comment_parent'   => $comment_1,
    943                                 'comment_date_gmt' => date( 'Y-m-d H:i:s', $now - 100 ),
     943                                'comment_date_gmt' => gmdate( 'Y-m-d H:i:s', $now - 100 ),
    944944                        )
    945945                );
Note: See TracChangeset for help on using the changeset viewer.