Tribe__Date_Utils::interval( $interval_spec )
Builds and returns a DateInterval object from the interval specification.
For performance purposes the use of DateInterval specifications is preferred, so P1D is better than 1 day.
Return
(DateInterval) The built date interval object.
Source
File: src/Tribe/Date_Utils.php
public static function interval( $interval_spec ) {
try {
$interval = new \DateInterval( $interval_spec );
} catch ( \Exception $e ) {
$interval = DateInterval::createFromDateString( $interval_spec );
}
return $interval;
}
Changelog
| Version | Description |
|---|---|
| 4.10.2 | Introduced. |