Is there a function that uses the date()
format to interpret a string?
echo date(\'s-i-H d:m:Y\', 1304591364); // 34-29-17 05:05:2011
// Does t
The accepted answer is right IMO, but you can also use the OO syntax: DateTime::createFromFormat
eg:
$dateTimeObject = \DateTime::createFromFormat('G:i', '9:30');
$dateTimeObject->format('H:i');
See http://php.net/manual/en/function.date.php for formatting guides, and http://php.net/manual/en/datetime.createfromformat.php for info on the method described above.