Many of us do not realize that MySQL’s Timestamp is not the timestamp which PHP date() understands. Beaucoup d'entre nous ne se rendent pas compte que MySQL de temps n'est pas la date qui PHP date () comprend. In fact if you try to use MySQL timestamp directly in php date() function then you will get totally wrong dates. En fait si vous essayez d'utiliser MySQL timestamp directement en php date () alors vous aurez totalement erreurs de date. There is a simple way to use MySQL timestamp data in php. Il est un moyen simple d'utiliser l'heure de données MySQL en PHP.

First you need to modify the SQL query to use MySQL’s UNIX_TIMESTAMP() function. Tout d'abord, vous devez modifier la requête SQL d'utiliser MySQL UNIX_TIMESTAMP (). So if your SQL looks like: Donc, si votre SQL se présente comme suit:
SELECT author, `when` … SELECT auteur, «quand»…

then convert it to: ensuite, convertissez-le à:
SELECT author, UNIX_TIMESTAMP(`when`) … SELECT auteur, UNIX_TIMESTAMP ( «quand»)…

Then use PHP’s date() function to convert the unix timestamp to appropriate display format like this: Ensuite, utilisez PHP jour () pour convertir les unix timestamp d'ouvrir, format d'affichage comme ceci:
date(”F j, Y, g:i a”, $row[1]) date ( "F j, Y, g: i", $ row [1])

where $row[1] contains the timestamp column value. où $ row [1] contient la valeur de colonne timestamp.