WordPress at a glance
function is not described


TimeInterval::iterate() public WC 1.0

Returns beginning of next time interval for provided DateTime.

E.g. for current DateTime, beginning of next day, week, quarter, etc.

{} It's a method of the class: TimeInterval{}

No Hooks.


DateTime. Nothing.


$result = TimeInterval::iterate( $datetime, $time_interval, $reversed );
$datetime(DateTime) (required)
Date and time.
$time_interval(string) (required)
Time interval, e.g. week, day, hour.
Going backwards in time instead of forward.

Code of TimeInterval::iterate() WC 5.3.0

public static function iterate( $datetime, $time_interval, $reversed = false ) {
	return call_user_func( array( __CLASS__, "next_{$time_interval}_start" ), $datetime, $reversed );