Re: time() question

From: Date: Thu, 13 Mar 2003 17:13:52 +0000
Subject: Re: time() question
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-139553@lists.php.net to get a copy of this message
Is there an easy way to display the epoch time given by time() in a human readable format? Basically, if I do $time = time(); and the insert that data into my mysql database and then pull that information out again how do I make it look like 2003-03-13 or a variant of that?
If you are pulling a date/time out of a MySQL database, use MySQL's DATE_FORMAT() function to format the value. For that matter, you can use MySQL's NOW() function (or others) when inserting the time. Otherwise, just in PHP, you can use the DATE() function to format dates. Larry

« previous php.general (#139553) next »