I am trying to parse a combination of date and date and time strings and would like to know if there is a more sensible way
Data examples
9/3/2013 8:50:05 AM 9/4/2013 1:42:28 PM 9/11/2013 12:01:21 PM ....
Here is what I do .. Looking through the list of Date Time strings
<?php $x = "9/3/2013 8:50:05 AM" $ExDt = str_getcsv(trim($x," "); $ExDate = $ExDt[0]; $ExTm = $ExDt[1] . " " . $ExDt[2]; $ExTime = date("H:i:s", strtotime($ExTm)); // Change to 24 hour format echo $ExDate; echo $ExTime; ?>
Tim b source share