php - date() expects parameter 2 to be integer, string given - Help Me -
my laravel 5.2 code
$this->timestamp=date('y-m-d',intval($timestamp)); $datetime=date('y/m/d', $timestamp);
date() expects parameter 2 integer, string given
that error occur. error show when choose day 31, not on other days (1 30). other days ok.
when change code that
$this->timestamp=date('y-m-d',intval($timestamp)); $datetime=date('y/m/d', intval($timestamp));
error solved date show not correct. date show 1970/01/01 please me, how fix this?
since you're using laravel, can carbon:
carbon::parse($timestamp)->format('y-m-d');
Comments
Post a Comment