What potential pitfalls should be considered when working with dates in PHP?

One potential pitfall when working with dates in PHP is the inconsistency in date formats across different systems or locales. To mitigate this issue, it's recommended to always use the ISO 8601 date format (YYYY-MM-DD) when storing or transmitting dates in PHP.

// Example of using ISO 8601 date format
$date = date('Y-m-d');
echo $date;