$date = DateTime::createFromFormat('m-d-Y, H:i A', '05-21-2005, 12:27 AM');
echo $date->format('Y-m-d H:i:s');
https://ideone.com/kGvh91 SELECT * FROM tableName WHERE timestampField BETWEEN 1438383600 AND 1440975600
echo strtotime(date('Y-m-01'));
echo strtotime(date('Y-m-t'));