<?php
$time="2015/04/10 00:40";
echo substr($time,0,10); //Imprime los primeros 10 caracteres
echo "<br>";
echo substr($time,-6); //imprie los ultimos 6
?>
2015/04/10
00:40
<?php
$date="2015/04/11 15:20";
//$time=mktime($hour,$minute,$second,$month,$day,$year);
$time = explode("/",$date);
echo $time[0]." Year";
echo "<br>";
echo $time[1]." Month";
echo "<br>";
echo $time[2]." Day Hour minute";
echo "<br>";
echo substr($time[2],0,2)." Day";
echo "<br>";
echo substr($time[2],-2)." minutes";
echo "<br>";
echo substr($time[2],3,2)." Hour";
?>
2015 Year
04 Month
11 15:20 Day Hour minute
11 Day
20 minutes
15 Hour
No hay comentarios:
Publicar un comentario