In a DB table I have several fields with datetime as field type. So I need to persist data only as date time object.
datetime
From a form I get date time as string l
How about createFromFormat?
http://uk.php.net/manual/en/datetime.createfromformat.php
$from = DateTime::createFromFormat($post['started_at'], 'Y-m-d H:i:s');