WordPress at a glance
function is not described

Automattic\WooCommerce\Admin\API\Reports

DataStore::create_interval_subtotals() protected WC 1.0

Change structure of intervals to form a correct response.

Also converts local datetimes to GMT and adds them to the intervals.

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

No Hooks.

Return

null. Nothing.

Usage

// protected - for code of main (parent) or child class
$result = $this->create_interval_subtotals( $intervals );
$intervals(array) (required) (passed by reference — &)
Time interval, e.g. day, week, month.

Code of DataStore::create_interval_subtotals() WC 5.3.0

<?php
protected function create_interval_subtotals( &$intervals ) {
	foreach ( $intervals as $key => $interval ) {
		$start_gmt = TimeInterval::convert_local_datetime_to_gmt( $interval['date_start'] );
		$end_gmt   = TimeInterval::convert_local_datetime_to_gmt( $interval['date_end'] );
		// Move intervals result to subtotals object.
		$intervals[ $key ] = array(
			'interval'       => $interval['time_interval'],
			'date_start'     => $interval['date_start'],
			'date_start_gmt' => $start_gmt->format( TimeInterval::$sql_datetime_format ),
			'date_end'       => $interval['date_end'],
			'date_end_gmt'   => $end_gmt->format( TimeInterval::$sql_datetime_format ),
		);

		unset( $interval['interval'] );
		unset( $interval['date_start'] );
		unset( $interval['date_end'] );
		unset( $interval['datetime_anchor'] );
		unset( $interval['time_interval'] );
		$intervals[ $key ]['subtotals'] = (object) $this->cast_numbers( $interval );
	}
}