added very basic timezone support to IXR_Date
git-svn-id: https://develop.svn.wordpress.org/trunk@1564 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
63ab3d066c
commit
d69d080abc
|
@ -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)) {
|
||||
|
@ -620,14 +621,15 @@ class IXR_Date {
|
|||
}
|
||||
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>';
|
||||
|
|
Loading…
Reference in New Issue