Menu
Riverview Church

DATE_INTERVAL_CREATE_FROM_DATE_STRING

Sets up a DateInterval from the relative parts of the string

SYNTAX

date_interval_create_from_date_string ( string $datetime ) : DateInterval

PARAMETERS

datetime

A date with relative parts. Specifically, the relative formats supported by the parser used for strtotime() and DateTime will be used to construct the DateInterval.

RETURN

Returns a new DateInterval instance.

EXAMPLES

1

1

2

2021-01-15 20:46:56
2021-01-15 20:46:57
2021-01-15 20:47:56
2021-01-15 21:46:56
2021-01-16 20:46:56
2021-01-22 20:46:56
2021-02-15 20:46:56
2022-01-15 20:46:56

PHP