Easy Tutorial
❮ Php Debug_Zval_Dump Function Php Mysql Insert ❯

PHP date_sub() Function

PHP Date/Time Reference Manual

Example

Subtract 40 days from March 15, 2013:


Definition and Usage

The date_sub() function subtracts days, months, years, hours, minutes, and seconds from a specified date.

Syntax

Parameter Description
object Required. Specifies a DateTime object returned by date_create()
interval Required. Specifies a DateInterval object.

Technical Details

Return Value: Returns a DateTime object on success, FALSE on failure.
PHP Version: 5.3+
--- ---
❮ Php Debug_Zval_Dump Function Php Mysql Insert ❯