php - strtotime return false while converting date string -
php - strtotime return false while converting date string -
using php 5.4.34 , laravel 4 apache 2.2.22 , ubuntu.
i seek convert string '2050-10-13'
date , homecoming false.
var_dump(strtotime('2050-10-13')); ==> false var_dump(strtotime('13-10-2050')); ==> false var_dump(strtotime('2050/10/13')); ==> false var_dump(strtotime('13/10/2050')); ==> false
i tried add together before :
date_default_timezone_set('europe/brussels');
or
date_default_timezone_set('europe/paris');
i doesn't alter anything.
in app/config/app.php
have :
'timezone' => 'utc', 'locale' => 'en',
what problem ??
2050
cannot represented internally on 32 bit systems. timestamp have limit 2038 because max value 32-bit integer 2,147,483,647
, is: 2038-01-19t03:14:08+0000z
you have experienced year2038
bug.
don't utilize timestamp. instead utilize more robust library such new \datetime('2050-10-13');
, of course of study on database utilize date
field.
php datetime laravel strtotime
Comments
Post a Comment