2011-03-14 15 views
36

que necesito para convertir a formato strtotime btime fecha (de 1307595105 a 06/08/2011 09:51:45 PM PDT) en phpconvertido strtotime al formato de fecha y hora en php

Podría por favor darme una respuesta

+9

http://php.net/strtotime y para formatear la fecha, http://php.net/date - la información está allí. –

Respuesta

12
<?php 
    echo date('d - m - Y',strtotime('2013-01-19 01:23:42')); 
?>  
Out put : 19 - 01 - 2013 
+0

Esa ni siquiera es la pregunta que se hizo. –

4
FORMAT DATE STRTOTIME OR TIME STRING TO DATE FORMAT 
$unixtime = 1307595105; 
function formatdate($unixtime) 
{ 
     return $time = date("m/d/Y h:i:s",$unixtime); 
} 
7

Uso date() función para obtener la fecha deseada

<?php 
// set default timezone 
date_default_timezone_set('UTC'); 

//define date and time 
$strtotime = 1307595105; 

// output 
echo date('d M Y H:i:s',$strtotime); 

// more formats 
echo date('c',$strtotime); // ISO 8601 format 
echo date('r',$strtotime); // RFC 2822 format 
?> 

herramienta en línea recomendada para strtotime de conversión de la fecha:

http://freeonlinetools24.com/

0

Aquí es exp.

$date_search_strtotime = strtotime(date("Y-m-d")); 
echo 'Now strtotime date : '.$date_search_strtotime; 
echo '<br>'; 
echo 'Now date from strtotime : '.date('Y-m-d',$date_search_strtotime); 
Cuestiones relacionadas