I have written the following code:
$timestamp = "1483625713000";
$date = date('d-m-Y', $timestamp);
$time = date('Gi.s', $timestamp);
but the output is not coming as expected: My outputs:
echo $date // 23-03-48984
echo $time // 2136.40
I have written the following code:
$timestamp = "1483625713000";
$date = date('d-m-Y', $timestamp);
$time = date('Gi.s', $timestamp);
but the output is not coming as expected: My outputs:
echo $date // 23-03-48984
echo $time // 2136.40
Looks like you've got milliseconds in that timestamp. Try this:
$timestamp = 1483625713000 / 1000;
$date = date('d-m-Y', $timestamp);
$time = date('Gi.s', $timestamp);
var_dump($date);
var_dump($time);
Outputs
string(10) "05-01-2017"
string(7) "1415.13"