Domanda

Come posso convertire questa data:

2009-12-21 10:38:07

per una data più leggibile, come 22 December 2009 - 10:38 ?

È stato utile?

Soluzione

È possibile utilizzare il href="http://be.php.net/manual/en/function.date.php" rel="nofollow noreferrer"> date funzione strtotime :

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

Altri suggerimenti

// Prints: July 1, 2000 is on a Saturday
echo "July 1, 2000 is on a " . date("l", mktime(0, 0, 0, 7, 1, 2000));
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top