Pregunta

¿Cómo puedo convertir esta fecha:

2009-12-21 10:38:07

a una fecha más legible, como 22 December 2009 - 10:38 ?

¿Fue útil?

Solución

Puede utilizar el href="http://be.php.net/manual/en/function.date.php" rel="nofollow noreferrer"> date función con strtotime :

$strDate = "2009-12-21 10:38:07";
echo date('d F Y - H:i', strtotime($strDate));

Otros consejos

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top