Bug #80185 [PATCH]: jdtounix() fails after 2037
Edit report at https://bugs.php.net/bug.php?id=80185&edit=1
ID: 80185
Patch added by: cmb@php.net
Reported by: php at y-mail dot ml
Summary: jdtounix() fails after 2037
Status: Verified
Type: Bug
Package: *Calendar problems
Operating System: Ubuntu 20.04
PHP Version: 7.4.11
Assigned To: cmb
Block user comment: N
Private report: N
New Comment:
The following pull request has been associated:
Patch Name: Fix #80185: jdtounix() fails after 2037
On GitHub: https://github.com/php/php-src/pull/6288
Patch: https://github.com/php/php-src/pull/6288.patch
Previous Comments:
------------------------------------------------------------------------
[2020-10-04 20:28:22] danack@php.net
Actually, I'm not sure it isn't a bug, so I've reopened it.
For systems that use 64 bit time_t, the unix times will still work.
But for this function, it seems to be hard-coded to return false after day 24755
https://github.com/php/php-src/blob/969a432fd8b34a0ec4e48e903370f0659aef6b04/ext/calendar/cal_unix.c#L63
That hard-coding could be removed for systems that support 64 bit time.
So maybe you can keep using that function.
------------------------------------------------------------------------
[2020-10-04 19:11:27] php at y-mail dot ml
Dan replied to me, no longer relevant.
Thank you.
------------------------------------------------------------------------
[2020-10-04 19:07:32] danack@php.net
Probably, you should start planning to not use that function at some point in the next 17 years.
https://en.wikipedia.org/wiki/Year_2038_problem
------------------------------------------------------------------------
[2020-10-04 19:04:10] php at y-mail dot ml
Description:
------------
I tried to calculate dates for a few years ahead and it turned out not that the jdtounix function
does not work after the year 2037.
Test script:
---------------
<?php
var_dump(jdtounix(2465712)); // => false
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=80185&edit=1
Thread (7 messages)