What are common pitfalls when working with dates in PHP, especially when handling dates before 1970 on Windows systems?

When working with dates in PHP, especially handling dates before 1970 on Windows systems, a common pitfall is the limitation of the Unix timestamp, which starts from January 1, 1970. To handle dates before 1970, you can use the DateTime class in PHP, which provides better support for older dates.

$dateString = '1969-12-31';
$date = new DateTime($dateString);
echo $date->format('Y-m-d');