This question already has an answer here:
I have hour and time variable chosen by the client. $Arrival_Hour - chosen in 01:00, 02:00 24 hrsformat $Arrival_Min - chosen in 00:05, 00:10 5 min difference format.
Now i am writing
Hour: <?php echo $Arrival_Hour?>
Min : <?php echo $Arrival_Min?>
and it comes Hour:01:00 Min: 00:15
How i can write this in 01:15 format?
Hour: 01:15 - (hour and min together)
Thanks
</div>
As quick workaround you could try:
Time: <?php echo substr($Arrival_Hour, 0, 2) . ':'. substr($Arrival_Min, 3, 5);?>
It's not perfect solution but you will get what you want.
Can you try this,
list($H, $Ht) = @explode(":", $Arrival_Hour);
list($Tt, $T) = @explode(":", $Arrival_Min);
echo $Time = $H.':'.$T;
Hour: <?php echo date("H",strtotime($Arrival_Hour));?>
Min : <?php echo date("i",strtotime($Arrival_Min));?>