In Magneto 2, the time beyond the year 2038 will wrap around and be stored internally as a negative number, which the system will interpret as having occurred on December 13, 1901, rather than January 19, 2038. This problem is similar to the Millennium Bug.
Of course, by that time, all the servers will be upgraded to avoid the issue, but let’s see how this problem may affect your time-sensitive settings in Magento 2.
If you accidentally choose the longest valid period possible for a coupon, it won’t work. This issue is also present on Magento 1, but it’s easier to choose the max period in Magento 2 thanks to the interface:
Now, the coupon stops working because Magento, as all other platforms working on MySQL can’t accept and store dates after 2038 in the timestamp fields.
If we set a date later than the year 2038, it just slips to the year 1970, leaving us with an invalid coupon or any other feature that uses the timestamp fields.
To avoid this issue, I implemented an extension, which helps to avoid such accidents. In the future, such fixes won’t be needed, as the issue will be solved on a server level.
The extension simply makes it impossible to choose any dates after the year 2037 in your Magento 2. Technically, this is not a fix, but it is a workaround to avoid accidental issues with all the Magento 2 features that are using dates. Instead of explaining the issue to all the store managers, you can simply install this extension and be sure everything works.
Feel free to download the extension or share it with your fellow Magento 2 users and developers.