- md5
- e55c203f0ae9e643995e451f5c68154a
- sha1
- f1648b3983f0057d620a06507888242c860e46aa
- sha256
- f51ab9f34bae4d2b06b07521723503b7a2431d0a97b2c3ca1e589c47bfa8ef41
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
<?php
//*******************************************************************
//iso8601 datetime class
//*******************************************************************
//by John Heinstein
//[email protected]
//*******************************************************************
//Version 0.1
//copyright 2004 Engage Interactive
//http://www.engageinteractive.com/dom_xmlrpc/
//All rights reserved
//*******************************************************************
//Licensed under the GNU General Public License (GPL)
//http://www.gnu.org/licenses/gpl-2.0.html
//*******************************************************************
class dom_xmlrpc_datetime_iso8601 {
var $year; var $month; var $day;
var $hour; var $minute; var $second;
function dom_xmlrpc_datetime_iso8601($datetime) {
if (is_int($datetime)) {
$this->fromDateTime_php($datetime);
}
else {
$this->fromDateTime_iso($datetime);
}
} //dom_xmlrpc_datetime_iso8601
function phpToISO(&$phpDate) {
return (date('Y', $phpDate) . date('m', $phpDate) . date('d', $phpDate) .
'T'. date('H', $phpDate). ':' . date('i', $phpDate) . ':' . date('s', $phpDate));
} //phpToISO
function fromDateTime_php($phpdatetime) {
//input php date time
$this->year = date('Y', $phpdatetime);
$this->month = date('m', $phpdatetime);
$this->day = date('d', $phpdatetime);
$this->hour = date('H', $phpdatetime);
$this->minute = date('i', $phpdatetime);
$this->second = date('s', $phpdatetime);
} //fromDateTime_php
function fromDateTime_iso($isoFormattedString) {
//input iso date time
$this->year = substr($isoFormattedString, 0, 4);
$this->month = substr($isoFormattedString, 4, 2);
$this->day = substr($isoFormattedString, 6, 2);
$this->hour = substr($isoFormattedString, 9, 2);
$this->minute = substr($isoFormattedString, 12, 2);
$this->second = substr($isoFormattedString, 15, 2);
} //fromDateTime_iso
function getDateTime_iso() {
//return iso date time
return ($this->year . $this->month . $this->day .
'T'. $this->hour . ':' . $this->minute . ':' . $this->second);
} //getDateTime_iso
function getDateTime_php() {
//return php date time
return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);
} //getDateTime_php
} //dom_xmlrpc_datetime_iso8601
?>
The same content is in 2 releases, Joomla 1.0.14 to 1.0.15. See them all, or every version of this file.