tribe_get_start_time( int $event = null, string $date_format = '', string $timezone = null )

Start Time

Returns the event start time


Parameters

$event

(int) (Optional) (optional)

Default value: null

$date_format

(string) (Optional) Allows date and time formating using standard php syntax (<a href="http://php.net/manual/en/function.date.php">http://php.net/manual/en/function.date.php</a>)

Default value: ''

$timezone

(string) (Optional) Timezone in which to present the date/time (or default behaviour if not set)

Default value: null


Top ↑

Return

(string|null) Time


Top ↑

Source

File: src/functions/template-tags/date.php

	function tribe_get_start_time( $event = null, $date_format = '', $timezone = null ) {
		if ( is_null( $event ) ) {
			global $post;
			$event = $post;
		}

		if ( is_numeric( $event ) ) {
			$event = get_post( $event );
		}

		if ( ! is_object( $event ) ) {
			return;
		}

		if ( Tribe__Date_Utils::is_all_day( get_post_meta( $event->ID, '_EventAllDay', true ) ) ) {
			return;
		}

		// @todo move timezones to Common
		if ( class_exists( 'Tribe__Events__Timezones' ) ) {
			$start_date = Tribe__Events__Timezones::event_start_timestamp( $event->ID, $timezone );
		}

		if ( '' == $date_format ) {
			$date_format = tribe_get_time_format();
		}

		/**
		 * Filters the returned event start time
		 *
		 * @param string  $start_date
		 * @param WP_Post $event
		 */
		return apply_filters( 'tribe_get_start_time', tribe_format_date( $start_date, false, $date_format ), $event );
	}