Logo Search packages:      
Sourcecode: zendframework version File versions  Download package

Zend_Date::sub ( date,
part = self::TIMESTAMP,
locale = null 

Subtracts a date from another date. This could be for example a RFC2822 date, the time, the year or only the timestamp. There are about 50 different supported date parts. For a complete list of supported datepart values look into the docu Be aware: Adding -2 Months is not equal to Subtracting 2 Months !!!

string | integer | array | Zend_Date$dateDate or datepart to subtract
string$partOPTIONAL Part of the date to sub, if null the timestamp is subtracted
string | Zend_Locale$localeOPTIONAL Locale for parsing input
integer|string new datepart

Definition at line 1117 of file Date.php.

References _calculate(), and Zend_Locale_Format::convertPhpToIsoFormat().

Referenced by _calcdetail().

        if (self::$_options['format_type'] == 'php') {
            $part = Zend_Locale_Format::convertPhpToIsoFormat($part);

        $this->_calculate('sub', $date, $part, $locale);
        return $this;

Here is the call graph for this function:

Here is the caller graph for this function:

Generated by  Doxygen 1.6.0   Back to index