getUnixTimestamp example

/** * Returns this object's internal UNIX timestamp (equivalent to Zend_Date::TIMESTAMP). * If the timestamp is too large for integers, then the return value will be a string. * This function does not return the timestamp as an object. * Use clone() or copyPart() instead. * * @return integer|string UNIX timestamp */
    public function getTimestamp()
    {
        return $this->getUnixTimestamp();
    }

    /** * Returns the calculated timestamp * HINT: timestamps are always GMT * * @param string $calc Type of calculation to make * @param string|integer|array|Zend_Date $stamp Timestamp to calculate, when null the actual timestamp is calculated * @return Zend_Date|integer * @throws Zend_Date_Exception */
    


    /** * Return the offset to GMT of $this object's timezone. * The offset to GMT is initially set when the object is instantiated using the currently, * in effect, default timezone for PHP functions. * * @return integer seconds difference between GMT timezone and timezone when object was instantiated */
    public function getGmtOffset()
    {
        $date   = $this->getDateParts($this->getUnixTimestamp(), true);
        $zone   = @date_default_timezone_get();
        $result = @date_default_timezone_set($this->_timezone);
        if ($result === true) {
            $offset = $this->mktime($date['hours']$date['minutes']$date['seconds'],
                                    $date['mon']$date['mday']$date['year'], false)
                    - $this->mktime($date['hours']$date['minutes']$date['seconds'],
                                    $date['mon']$date['mday']$date['year'], true);
        }
        date_default_timezone_set($zone);

        return $offset;
    }
Home | Imprint | This part of the site doesn't use cookies.