Automattic\WooCommerce\Admin\API\Reports

TimeInterval::iterate()public staticWC 1.0

Returns beginning of next time interval for provided DateTime.

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

Method of the class: TimeInterval{}

No Hooks.

Return

DateTime.

Usage

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

TimeInterval::iterate() code WC 7.3.0

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