In our DB tables, we columns refID and date are a composite primary key, with one field of the identifier being mapped as a datetime:<
refID
date
datetime
Be careful with
return new DateTimeEx('@' . $dateTime->format('U'));
The timezone won't be good. You should do :
$val = new DateTimeEx('@' . $dateTime->format('U')); $val->setTimezone($dateTime->getTimezone()); return $val;