DatePeriod::getStartDate

(PHP 5 >= 5.6.5, PHP 7, PHP 8)

DatePeriod::getStartDate Obtiene la fecha de inicio

Descripción

Estilo orientado a objetos

public DatePeriod::getStartDate(): DateTimeInterface

Obtiene la fecha de inicio de un período.

Parámetros

Esta función no tiene parámetros.

Valores devueltos

Devuelve un object DateTimeImmutable cuando la DatePeriod se inicializa con un object DateTimeImmutable como argumento start.

Devuelve un object DateTime en los demás casos.

Ejemplos

Ejemplo #1 Ejemplo DatePeriod::getStartDate()

<?php
$period
= new DatePeriod('R7/2016-05-16T00:00:00Z/P1D');
$start = $period->getStartDate();
echo
$start->format(DateTime::ISO8601);
?>

El resultado del ejemplo sería:

2016-05-16T00:00:00+0000

Ver también

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top