Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
32-Bit Year 2038 Issue - Do We Care?
12-13-2018, 01:31 AM, (This post was last modified: 12-13-2018, 01:54 AM by VortecCPI.)
#1
32-Bit Year 2038 Issue - Do We Care?
BOMs.php

When adding a new BoM item...

The code below results in 12/31/1969:

PHP Code:
$_POST['EffectiveTo'] = Date($_SESSION['DefaultDateFormat'], Mktime(000Date('m'), Date('d'), (Date('y') + 20))); 

The code below results in 12/12/2037:

PHP Code:
$_POST['EffectiveTo'] = Date($_SESSION['DefaultDateFormat'], Mktime(000Date('m'), Date('d'), (Date('y') + 10))); 

Any ideas on this nonsense?
What the???

https://en.wikipedia.org/wiki/Year_2038_problem
More here: https://www.phpclasses.org/blog/package/...tamps.html
https://www.linkedin.com/in/eclipsepaulbecker
Reply
12-13-2018, 06:38 PM,
#2
RE: 32-Bit Year 2038 Issue - Do We Care?
I think this issue has been resolved in PHP7.

$_POST['EffectiveTo'] = Date($_SESSION['DefaultDateFormat'], Mktime(0, 0, 0, Date('m'), Date('d'), (Date('y') + 20)));

shows 12/13/2038 on my PHP7 machine.

tim
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)