Inventory_Presser_Shortcode_Hours_Today::create_date_object_from_hour_string( string $hour_string )

create_date_object_from_hour_string


Description

Create a DateTime object from a string like "9:00 AM"


Parameters

$hour_string

(string) (Required) A string like "9:00 AM"


Return

(DateTime)


Source

File: includes/shortcode/class-shortcode-hours-today.php

	static function create_date_object_from_hour_string( $hour_string ) {
		return DateTime::createFromFormat( 'g:ia', strtolower( str_replace( ' ', '', $hour_string ) ) );
	}