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

search for in the

DateInterval::format> <DateInterval::__construct
Last updated: Fri, 20 May 2011

view this page in

DateInterval::createFromDateString

(PHP 5 >= 5.3.0)

DateInterval::createFromDateStringEstablece un objeto DateInterval desde las partes relativas de una cadena

Descripción

public static DateInterval DateInterval::createFromDateString ( string $time )

Usa el analizador de fechas normal y estblece un objeto DateInterval desde las partes relativas de la cadena analizada.

Parámetros

time

La fecha con las partes relativas.

Valores devueltos

Devuelve una nueva instancia de DateInterval si se tuvo éxito.



add a note add a note User Contributed Notes DateInterval::createFromDateString
msleman at boot dot dot dot com 29-Oct-2010 03:39
Sample usage:

<?php
$interval
= DateInterval::createFromDateString('1 month');
?>
Anonymous 28-Sep-2009 07:02
DateInterval::createFromDateString ( string $time )

When the manual says "Uses the normal date parsers" it means that this function cannot take $time = ISO8601 strings like "P7D".  If you want to use those, you must use the constructor.

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