Tribe__Date_Utils::reformat( $dt_string,  $new_format )

Accepts a string representing a date/time and attempts to convert it to the specified format, returning an empty string if this is not possible.


Parameters

$dt_string

(Required)

$new_format

(Required)


Top ↑

Return

(string)


Top ↑

Source

File: src/Tribe/Date_Utils.php

		public static function reformat( $dt_string, $new_format ) {
			$timestamp = self::is_timestamp( $dt_string ) ? $dt_string : strtotime( $dt_string );
			$revised   = date( $new_format, $timestamp );

			return $revised ? $revised : '';
		}