WordPress.org

Make WordPress Core

Ticket #3995: 3995.2.diff

File 3995.2.diff, 1.7 KB (added by rob1n, 11 years ago)
  • wp-includes/class-IXR.php

     
    608608        }
    609609    }
    610610    function parseTimestamp($timestamp) {
    611         $this->year = date('Y', $timestamp);
    612         $this->month = date('m', $timestamp);
    613         $this->day = date('d', $timestamp);
    614         $this->hour = date('H', $timestamp);
    615         $this->minute = date('i', $timestamp);
    616         $this->second = date('s', $timestamp);
     611        $this->year = gmdate('Y', $timestamp);
     612        $this->month = gmdate('m', $timestamp);
     613        $this->day = gmdate('d', $timestamp);
     614        $this->hour = gmdate('H', $timestamp);
     615        $this->minute = gmdate('i', $timestamp);
     616        $this->second = gmdate('s', $timestamp);
    617617    }
    618618    function parseIso($iso) {
    619         $this->year = substr($iso, 0, 4);
    620         $this->month = substr($iso, 4, 2);
    621         $this->day = substr($iso, 6, 2);
    622         $this->hour = substr($iso, 9, 2);
    623         $this->minute = substr($iso, 12, 2);
    624         $this->second = substr($iso, 15, 2);
    625         $this->timezone = substr($iso, 17);
     619        $orig = $iso;
     620        $iso = strtotime($iso);
     621        $this->year = gmdate('Y', $iso);
     622        $this->month = gmdate('m', $iso);
     623        $this->day = gmdate('d', $iso);
     624        $this->hour = gmdate('G', $iso);
     625        $this->minute = gmdate('i', $iso);
     626        $this->second = gmdate('s', $iso);
     627        $this->timezone = 'Z';
    626628    }
    627629    function getIso() {
    628630        return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;
     
    812814    }
    813815}
    814816
    815 ?>
    816  No newline at end of file
     817?>