Definition :
In PHP date_interval_create_from_date_string(). Function is inbuilt function.PHP date_interval_create_from_date_string() function is used to set up a DateInterval from the relative part of the given string. It returns the new dateTime object as output.
date_interval_create_from_date_string(datetime)
Parameter | Description |
---|---|
datetime | Required. Specifies a DateInterval |
Given below example Use date_interval_create_from_date_string() to add 1 year and 25 days to a date:
Output : 2021-03-02