Tribe__Tickets__Ticket_Object::get_date( string $date = '', bool $as_timestamp = true )

Get a DateTime object or a Timestamp date representation of the object, if the DateTime object is used the timezone from the event associated with the ticket is going to be used to have a more accurate timestamp


Parameters

$date

(string) (Optional)

Default value: ''

$as_timestamp

(bool) (Optional)

Default value: true


Top ↑

Return

(DateTime|false|int)


Top ↑

Source

File: src/Tribe/Ticket_Object.php

		public function get_date( $date = '', $as_timestamp = true ) {
			if ( $as_timestamp ) {
				return strtotime( $date );
			}

			try {
				$timezone = $this->get_event_timezone();
				return new DateTime( $date, $timezone );
			} catch ( Exception $exception ) {
				return strtotime( $date );
			}
		}

Top ↑

Changelog

Changelog
Version Description
4.7.1 Introduced.