PHP 8.1.33
Preview: class-IXR-date.php Size: 1.65 KB
/home/jambtst2015/public_html/qasandra.com/wp-includes/IXR/class-IXR-date.php

<?php

/**
 * IXR_Date
 *
 * @package IXR
 * @since 1.5.0
 */
class IXR_Date {
    var $year;
    var $month;
    var $day;
    var $hour;
    var $minute;
    var $second;
    var $timezone;

	/**
	 * PHP5 constructor.
	 */
    function __construct( $time )
    {
        // $time can be a PHP timestamp or an ISO one
        if (is_numeric($time)) {
            $this->parseTimestamp($time);
        } else {
            $this->parseIso($time);
        }
    }

	/**
	 * PHP4 constructor.
	 */
	public function IXR_Date( $time ) {
		self::__construct( $time );
	}

    function parseTimestamp($timestamp)
    {
        $this->year = gmdate('Y', $timestamp);
        $this->month = gmdate('m', $timestamp);
        $this->day = gmdate('d', $timestamp);
        $this->hour = gmdate('H', $timestamp);
        $this->minute = gmdate('i', $timestamp);
        $this->second = gmdate('s', $timestamp);
        $this->timezone = '';
    }

    function parseIso($iso)
    {
        $this->year = substr($iso, 0, 4);
        $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.$this->timezone;
    }

    function getXml()
    {
        return '<dateTime.iso8601>'.$this->getIso().'</dateTime.iso8601>';
    }

    function getTimestamp()
    {
        return mktime($this->hour, $this->minute, $this->second, $this->month, $this->day, $this->year);
    }
}

Directory Contents

Dirs: 0 × Files: 14

Name Size Perms Modified Actions
414 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
4.67 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.23 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
1.65 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
854 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
5.20 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
8.00 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
927 B lrw-r--r-- 2024-11-22 17:53:26
Edit Download
6.51 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
3.70 KB lrw-r--r-- 2024-11-22 17:53:26
Edit Download
74 B lrw-r--r-- 2024-12-02 09:28:13
Edit Download
64.55 KB lrw-r--r-- 2024-12-02 09:28:13
Edit Download
4.04 KB lrw-r--r-- 2025-11-03 09:02:39
Edit Download
26 B lrw-r--r-- 2024-08-19 08:38:47
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).