Is it possible extract hour value from a date string like below
20151211091805 +0000
expected output-
09:18:05
(this should also be string)
Is it possible extract hour value from a date string like below
20151211091805 +0000
expected output-
09:18:05
(this should also be string)
Try this:
$t = "20151211091805";
echo date('H:i:s',strtotime($t));
Try this..
<?php
$timestamp = 20151211091805;
$date = new DateTime("$ts");
echo date_format($date, 'H:i:s');
?>