Re: time() question
| From: | Tom Woody | Date: | Thu, 13 Mar 2003 17:29:10 +0000 |
| Subject: | Re: time() question | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-139557@lists.php.net to get a copy of this message | ||
On Thu, 13 Mar 2003 12:07:33 -0500
"Tom Ray" <tom@blazestudios.com> wrote:
> 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?
>
in php you would do: (see
http://www.php.net/manual/en/function.date.php)
$date = date('Y-m-d',time());
in mysql you would do:
(http://www.mysql.com/doc/en/Date_and_time_functions.html)
select date_format('%Y-%m-%d', field) from table where ...;
--
Tom Woody
Systems Administrator
Don't throw your computer out the window,
throw the Windows out of your computer!