J'ai écrit un petit script bash qui m'a fait tomber sur le "bug de l'an 2038" . Je ne connaissais pas ce problème auparavant et j'ose juste publier la --debug
sortie que j'ai obtenue date
lorsque mon script a essayé de calculer à travers cette date magique (03:14:07 UTC le 19 janvier 2038).
date -d "20380119"
date: parsed number part: today/this/now
date: input timezone: +01:00 (set from system default)
date: warning: using midnight as starting time: 00:00:00
date: starting date/time: '(Y-M-D) 2038-01-19 00:00:00 TZ=+01:00'
date: '(Y-M-D) 2038-01-19 00:00:00 TZ=+01:00' = 2147468400 epoch-seconds
date: output timezone: +01:00 (set from system default)
date: final: 2147468400.000000000 (epoch-seconds)
date: final: (Y-M-D) 2038-01-18 23:00:00 (UTC0)
date: final: (Y-M-D) 2038-01-19 00:00:00 (output timezone TZ=+01:00)
Tue Jan 19 00:00:00 CET 2038
date -d "20380119 + 1 days"
date: parsed hybrid part: +1 day(s)
date: input timezone: +01:00 (set from system default)
date: warning: using midnight as starting time: 00:00:00
date: starting date/time: '(Y-M-D) 2038-01-19 00:00:00 TZ=+01:00'
date: warning: when adding relative days, it is recommended to specify 12:00pm
date: error: adding relative date resulted in an invalid date: '(Y-M-D) 2038-01-20 00:00:00 TZ=+01:00'
date: invalid date '20380119 + 1 days'
date -d "20380120" --debug
date: parsed number part: today/this/now
date: input timezone: +01:00 (set from system default)
date: warning: using midnight as starting time: 00:00:00
date: error: invalid date/time value:
date: user provided time: '(Y-M-D) 2038-01-20 00:00:00 TZ=+01:00'
date: normalized time: '(Y-M-D) 2038-01-20 00:00:00 TZ=+01:00'
date:
date: possible reasons:
date: numeric values overflow;
date: missing timezone
date: invalid date '20380120'
Existe-t-il un moyen de faire date
calculer GNU sur cette date?
(sur un système LINUX 32 bits)
Operating System: Debian GNU/Linux buster/sid
Kernel: Linux 4.12.0-2-686-pae
Architecture: x86
date
. Je vais modifier ma question ...