I have a select that selects the time in milliseconds passed to date using this sql statement:
$stmt = $dbh->prepare("SELECT from_unixtime(dd.ts, \'%D