Automattic\WooCommerce\Admin\API\Reports
TimeInterval::default_before()
Returns default 'before' parameter for the reports.
Method of the class: TimeInterval{}
No Hooks.
Return
DateTime
.
Usage
$result = TimeInterval::default_before();
TimeInterval::default_before() TimeInterval::default before code WC 9.6.0
public static function default_before() { $datetime = new \WC_DateTime(); // Set local timezone or offset. if ( get_option( 'timezone_string' ) ) { $datetime->setTimezone( new \DateTimeZone( wc_timezone_string() ) ); } else { $datetime->set_utc_offset( wc_timezone_offset() ); } return $datetime; }