Question

Comment puis-je convertir cette date:

2009-12-21 10:38:07

à une date plus lisible, comme 22 December 2009 - 10:38 ?

Était-ce utile?

La solution

Vous pouvez utiliser la fonction date avec strtotime :

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

Autres conseils

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top