WordPress.org

Make WordPress Core

Ticket #20942: gmt-date-matches.diff

File gmt-date-matches.diff, 537 bytes (added by wonderboymusic, 2 years ago)
  • wp-includes/formatting.php

     
    18651865 */ 
    18661866function get_gmt_from_date($string, $format = 'Y-m-d H:i:s') { 
    18671867        preg_match('#([0-9]{1,4})-([0-9]{1,2})-([0-9]{1,2}) ([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2})#', $string, $matches); 
     1868         
     1869        if ( ! $matches ) 
     1870                return null; 
     1871         
    18681872        $tz = get_option('timezone_string'); 
    18691873        if ( $tz ) { 
    18701874                date_default_timezone_set( $tz );