Tribe__Events__Repositories__Event::use_utc( bool $use_utc )

Instructs the repository to use UTC dates and times for reading operations or not.

By default the repository will use the events _EventStartDateUTC and _EventEndDateUTC meta keys depending on the site Time Zone Settings. This method allows overriding this behavior on a per-instance basis.


Parameters

$use_utc

(bool) (Required) Whether to use the UTC dates and times to read events or not. If true then the _EventStartDateUTC and _EventEndDateUTC meta keys will be used, if false then the _EventStartDate and _EventEndDate meta keys will be used.


Top ↑

Return

(static) This repository instance.


Top ↑

Source

File: src/Tribe/Repositories/Event.php

	public function use_utc( $use_utc ) {
		$this->normal_timezone = $use_utc ?
			new DateTimeZone( 'UTC' )
			: Timezones::build_timezone_object();
		$this->start_meta_key = $use_utc ? '_EventStartDateUTC' : '_EventStartDate';
		$this->end_meta_key = $use_utc ? '_EventEndDateUTC' : '_EventEndDate';

		return $this;
	}

Top ↑

Changelog

Changelog
Version Description
4.9 Introduced.