public static function createXMLDateObject($timestamp, $element = 'date', $date_format = 'Y-m-d', $time_format = 'H:i', $namespace = null)
    {
        if (!class_exists('XMLElement')) {
            return false;
        }

        if (empty($date_format)) {
            $date_format = DateTimeObj::getSetting('date_format');
        }
        if (empty($time_format)) {
            $time_format = DateTimeObj::getSetting('time_format');
        }

        $xDate = new XMLElement(
            (!is_null($namespace) ? $namespace . ':' : '') . $element,
            DateTimeObj::get($date_format, $timestamp),
            array(
                'iso' => DateTimeObj::get('c', $timestamp),
                'timestamp' => DateTimeObj::get('U', $timestamp),
                'time' => DateTimeObj::get($time_format, $timestamp),
                'weekday' => DateTimeObj::get('N', $timestamp),
                'offset' => DateTimeObj::get('O', $timestamp)
            )
        );

        return $xDate;
    }
public static function createXMLDateObject($timestamp, $element = 'date', $date_format = 'Y-m-d', $time_format = 'H:i', $namespace = null)
    {
        if (!class_exists('XMLElement')) {
            return false;
        }

        if (empty($date_format)) {
            $date_format = DateTimeObj::getSetting('date_format');
        }
        if (empty($time_format)) {
            $time_format = DateTimeObj::getSetting('time_format');
        }

        $xDate = new XMLElement(
            (!is_null($namespace) ? $namespace . ':' : '') . $element,
            DateTimeObj::get($date_format, $timestamp),
            array(
                'iso' => DateTimeObj::get('c', $timestamp),
                'timestamp' => DateTimeObj::get('U', $timestamp),
                'time' => DateTimeObj::get($time_format, $timestamp),
                'weekday' => DateTimeObj::get('N', $timestamp),
                'offset' => DateTimeObj::get('O', $timestamp)
            )
        );

        return $xDate;
    }
public static function createXMLDateObject ( $ timestamp , $ element = 'date' , $ date_format = 'Y-m-d' , $ time_format = 'H:i' , $ namespace = null ) { if ( ! class_exists ( 'XMLElement' ) ) { return false ; } if ( empty ( $ date_format ) ) { $ date_format = DateTimeObj :: getSetting ( 'date_format' ) ; } if ( empty ( $ time_format ) ) { $ time_format = DateTimeObj :: getSetting ( 'time_format' ) ; } $ xDate = new XMLElement ( ( ! is_null ( $ namespace ) ? $ namespace . ':' : '' ) . $ element , DateTimeObj :: get ( $ date_format , $ timestamp ) , array ( 'iso' => DateTimeObj :: get ( 'c' , $ timestamp ) , 'timestamp' => DateTimeObj :: get ( 'U' , $ timestamp ) , 'time' => DateTimeObj :: get ( $ time_format , $ timestamp ) , 'weekday' => DateTimeObj :: get ( 'N' , $ timestamp ) , 'offset' => DateTimeObj :: get ( 'O' , $ timestamp ) ) ) ; return $ xDate ; }
Construct an XML fragment that reflects the structure of the input timestamp.

@param integer $timestamp
the timestamp to construct the XML element from.
@param string $element (optional)
the name of the element to append to the namespace of the constructed XML.
this defaults to "date".
@param string $date_format (optional)
the format to apply to the date, defaults to `Y-m-d`.
if empty, uses DateTimeObj settings.
@param string $time_format (optional)
the format to apply to the date, defaults to `H:i`.
if empty, uses DateTimeObj settings.
@param string $namespace (optional)
the namespace in which the resulting XML entity will reside. this defaults
to null.
@return boolean|XMLElement
false if there is no XMLElement class on the system, the constructed XML element
otherwise.
Construct an XML fragment that reflects the structure of the input timestamp .