MySQL DATETIME format comparison - is strtotime needed?
- by Steffan
I've been doing something along the lines of..
$dt1 = '1000-01-01 00:00:00'; //really some val from db
$dt2 = '1000-01-01 00:00:10'; //another val maybe db maybe formatted
if(strtotime($dt1) > strtotime($dt2){
//do something
}
Is the strtotime needed? can i do a more direct comparison on the datetime formatted strings?
i.e.
if($dt1 > $dt2){
//do something
}
Will that always work?