Inventory_Presser_Shortcode_Hours_Today::create_date_object_from_hour_string( string $hour_string )
create_date_object_from_hour_string
Contents
Description Description
Create a DateTime object from a string like "9:00 AM"
Parameters Parameters
- $hour_string
-
(string) (Required) A string like "9:00 AM"
Return Return
(DateTime)
Source 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 ) ) ); }
Expand full source code Collapse full source code View on Github