I have a field in my database called time
. It contains UNIX timestamp. However the data type is a string and in php the date function expects an integer.
So i tried parsing the string to an integer but the value changes.
$time = $value['time'];
echo "Time string is $time<br/>";
settype($time,'integer');
echo "time intenger is".$time."<br/>";
This is the output i get
Time string is 1499327190163
time intenger is2147483647
What am i doing wrong here? Or is there a better way to convert timestamp to a date? Thanks
EDIT : I just read the manual on settype and it said Maximum value for "int" is PHP_INT_MAX. Perhaps this could be my issue, would it be alright to change this, or should there be any security related concern in changing the max integer value?