Inventory_Presser_Shortcode_Hours_Today::create_date_object_from_hour_string( string $hour_string )

create_date_object_from_hour_string


Description Description

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


Top ↑

Parameters Parameters

$hour_string

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


Top ↑

Return Return

(DateTime)


Top ↑

Source Source

File: includes/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 ) ) );
	}