Last active
November 24, 2024 10:19
-
-
Save vielhuber/613b3430a326382289197b87f3ac3854 to your computer and use it in GitHub Desktop.
date 32-bit 64-bit overflow DateTime 2038 #php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 32-bit | |
if (PHP_INT_SIZE == 4) { | |
echo date('Y-m-d',strtotime('2040-01-10T16:41:07+01:00')); | |
} | |
// 64-bit | |
if (PHP_INT_SIZE == 8) { | |
echo (new \DateTime('2040-01-10T16:41:07+01:00'))->format('Y-m-d'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment