Oihana PHP

isFuture.php

Table of Contents

Functions

isFuture()  : bool
Tells whether a date is strictly in the future.

Functions

isFuture()

Tells whether a date is strictly in the future.

isFuture(DateTimeInterface $date[, DateTimeInterface|null $now = null ]) : bool
Parameters
$date : DateTimeInterface

The date to test.

$now : DateTimeInterface|null = null

The reference "now". Defaults to the current date/time.

Tags
example
use function oihana\core\date\isFuture;

isFuture( new DateTimeImmutable( '2999-01-01' ) ) ; // true
isFuture( new DateTimeImmutable( '2000-01-01' ) ) ; // false
author

Marc Alcaraz (ekameleon)

since
1.0.9
Return values
bool

true if $date is strictly after $now, false otherwise.

On this page

Search results