What are best practices for converting dates into a sortable format in PHP?

When converting dates into a sortable format in PHP, it is best practice to use the strtotime() function to convert the date into a Unix timestamp, which can then be easily sorted numerically. This ensures that dates are converted into a format that can be compared and sorted accurately.

$date = "2022-05-15";
$sortable_date = strtotime($date);
echo $sortable_date;