downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | links | conferences | my php.net

search for in the

date_sun_info> <date_parse
[edit] Last updated: Fri, 24 Feb 2012

view this page in

date_sub

(PHP 5 >= 5.3.0)

date_subSinônimo de DateTime::sub()

Descrição

Esta função é um apelido para: DateTime::sub()



add a note add a note User Contributed Notes date_sub
Jonathan Poissant 21-Jan-2011 07:26
You cannot replace date_sub('2000-01-20') by DateTime::sub('2000-01-20') because DateTime::sub is not static. You have to create the DateTime object first.

Example:

<?php $dateA = date_sub('2000-01-20', date_interval_create_from_date_string('10 days')); ?>

will be replace by
<?php
$dateB
= new DateTime('2000-01-20');
$dateA = $dateB->sub(date_interval_create_from_date_string('10 days'));
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites