In what format should dates be stored in a database to facilitate efficient querying for upcoming events like birthdays in PHP?

Dates should be stored in a database in the format of 'YYYY-MM-DD' (e.g., '2022-09-15') to facilitate efficient querying for upcoming events like birthdays in PHP. Storing dates in this format allows for easy comparison and sorting of dates in SQL queries.

// Example SQL query to retrieve upcoming birthdays
$currentDate = date('Y-m-d');
$query = "SELECT * FROM users WHERE DATE_FORMAT(birthday, '%m-%d') = DATE_FORMAT('$currentDate', '%m-%d')";
$result = mysqli_query($connection, $query);

// Loop through the results and display upcoming birthdays
while ($row = mysqli_fetch_assoc($result)) {
    echo $row['name'] . "'s birthday is on " . date('F j', strtotime($row['birthday'])) . "<br>";
}