DateInterval
PHP Manual

DateInterval::createFromDateString

(PHP 5 >= 5.3.0)

DateInterval::createFromDateStringSets up a DateInterval from the relative parts of the string

说明

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

Uses the normal date parsers and sets up a DateInterval from the relative parts of the parsed string.

参数

time

Date with relative parts.

返回值

Returns new DateInterval instance if success.


DateInterval
PHP Manual