What are the advantages of using standard date formats in databases over custom formats for sorting and filtering in PHP?

When using standard date formats in databases, such as ISO 8601 (YYYY-MM-DD), it allows for easier sorting and filtering of dates in PHP. Custom date formats can lead to inconsistencies and errors when sorting or filtering dates. By using standard date formats, it ensures uniformity and simplifies the process of querying and manipulating dates in PHP.

// Example of sorting dates in PHP using standard date format (ISO 8601)
$query = "SELECT * FROM table_name ORDER BY date_column DESC";
$result = mysqli_query($connection, $query);

while ($row = mysqli_fetch_assoc($result)) {
    $date = date("Y-m-d", strtotime($row['date_column']));
    echo $date . "<br>";
}