Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Duplicate
-
None
-
None
Description
As described in this Reddit post, UNIX_TIMESTAMP does not work for dates beyond 2038. There was also some follow up discussion in another Reddit thread. All my dates are DATETIME fields in the database, and my application expects unixtimes returned from queries. Currently I use UNIX_TIMESTAMP to do this conversion.
SELECT UNIX_TIMESTAMP('2030-02-02 10:10:10'); # Works
SELECT UNIX_TIMESTAMP('2040-02-02 10:10:10'); # Broken
It would be great if UNIX_TIMESTAMP worked with dates beyond 2038, but it sounds like that may not be feasible due to INT32 vs INT64 limitations. If that is the case, then I would suggest a UNIX_TIMESTAMP64 be created to address this limitation.
I have UNIX_TIMESTAMP all over my code, so a simple search/replace to a new version would be simplest.
Attachments
Issue Links
- duplicates
-
MDEV-32188 make TIMESTAMP use whole 32-bit unsigned range
- Closed
- relates to
-
MDEV-9444 MariaDB needs to be Y2038-compliant
- Closed