This should get you there...
Assuming you are getting from a file name $infile
$fp = fopen($infile, "w");
$data = array();
while ($rec = fgetcsv($fp, 2048, "|")){
$data[] = $rec;
}
usort($data, function ($a, $b){
// if you want to reverse the sort swap a for b
return strtotime($b[1]) - strtotime($a[1]);
});
foreach($data as $v){
echo implode("|", $v)."\n";
}
Ouput to standard out ... you can just as easily fopen/fputcsv the same data.