PHP difference between time() and getTimestamp() object [Year 2038 bug] -
what difference between:
$now = time();
and
$now = new datetime(); $now->gettimestamp();
by taking account 32-bit int limitations (a.k.a year 2038 bug) safe use gettimestamp() in 32-bit system ?
edit:
for further information problem, check link: what unix timestamp , why use it?
what have tried? have done, confirm question?
simple enough:
$datetime = new datetime('5000-01-01'); var_dump($datetime->format('d.m.y')); var_dump($datetime->gettimestamp());
output:
string(10) "01.01.5000" bool(false)
so: no, not save
in using timestamp datetime.
anyway: question might reference, can easy found out testing.
the sence datetime not unix timestamp. avoiding unix timestamp. see answer own link comments: what unix timestamp , why use it?
Comments
Post a Comment