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:
michelvaldrighi 2004-08-26 12:40:48 +00:00
parent 63ab3d066c
commit d69d080abc

View File

@ -602,6 +602,7 @@ class IXR_Date {
var $hour; var $hour;
var $minute; var $minute;
var $second; var $second;
var $timezone;
function IXR_Date($time) { function IXR_Date($time) {
// $time can be a PHP timestamp or an ISO one // $time can be a PHP timestamp or an ISO one
if (is_numeric($time)) { if (is_numeric($time)) {
@ -625,9 +626,10 @@ class IXR_Date {
$this->hour = substr($iso, 9, 2); $this->hour = substr($iso, 9, 2);
$this->minute = substr($iso, 12, 2); $this->minute = substr($iso, 12, 2);
$this->second = substr($iso, 15, 2); $this->second = substr($iso, 15, 2);
$this->timezone = substr($iso, 17);
} }
function getIso() { 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() { function getXml() {
return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>'; return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';