note 28873 added to function.date

From: Date: Sun, 26 Jan 2003 19:11:33 +0000
Subject: note 28873 added to function.date
Groups: php.notes 
Request: Send a blank email to php-notes+get-42778@lists.php.net to get a copy of this message
I find when storing dates in a database it is best to store the UNIX timestamp instead of using the databases' silly date functions that are specific to that particular database. You can use the UNIX time stamp to show the date however you wish when you extract the time from the database. echo date('D M d, Y - H:i:s', $from_db->time); This also allows you to change the format the date displays in without messing with the database. -- http://www.php.net/manual/en/function.date.php http://master.php.net/manage/user-notes.php?action=edit+28873 http://master.php.net/manage/user-notes.php?action=delete+28873 http://master.php.net/manage/user-notes.php?action=reject+28873

« previous php.notes (#42778) next »