WordPress.org

Make WordPress Core


Ignore:
Timestamp:
06/26/2018 06:00:58 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Date/Time: Simplify mysql_to_rfc3339().

Erasing timezone with a regular expression is redundant, the date could be just formatted in the respective format instead.

Props Rarst.
Fixes #42542.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/functions.php

    r43383 r43384  
    58645864 */
    58655865function mysql_to_rfc3339( $date_string ) {
    5866     $formatted = mysql2date( 'c', $date_string, false );
    5867 
    5868     // Strip timezone information
    5869     return preg_replace( '/(?:Z|[+-]\d{2}(?::\d{2})?)$/', '', $formatted );
     5866    return mysql2date( 'Y-m-d\TH:i:s', $date_string, false );
    58705867}
    58715868
Note: See TracChangeset for help on using the changeset viewer.