Skip to content
This repository has been archived by the owner on Jul 7, 2020. It is now read-only.

Commit

Permalink
added very basic timezone support to IXR_Date
Browse files Browse the repository at this point in the history
git-svn-id: http://core.svn.wordpress.org/trunk@1564 1a063a9b-81f0-0310-95a4-ce76da25c4cd
  • Loading branch information
michelvaldrighi committed Aug 26, 2004
1 parent 263409f commit 8bc7ca7
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions wp-includes/class-IXR.php
Expand Up @@ -602,6 +602,7 @@ class IXR_Date {
var $hour;
var $minute;
var $second;
var $timezone;
function IXR_Date($time) {
// $time can be a PHP timestamp or an ISO one
if (is_numeric($time)) {
Expand All @@ -620,14 +621,15 @@ function parseTimestamp($timestamp) {
}
function parseIso($iso) {
$this->year = substr($iso, 0, 4);
$this->month = substr($iso, 4, 2);
$this->month = substr($iso, 4, 2);
$this->day = substr($iso, 6, 2);
$this->hour = substr($iso, 9, 2);
$this->minute = substr($iso, 12, 2);
$this->second = substr($iso, 15, 2);
$this->timezone = substr($iso, 17);
}
function getIso() {
return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second;
return $this->year.$this->month.$this->day.'T'.$this->hour.':'.$this->minute.':'.$this->second.$this->timezone;
}
function getXml() {
return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
Expand Down

0 comments on commit 8bc7ca7

Please sign in to comment.