Re: date output
| From: | Sandro T. Rafael | Date: | Wed, 30 Apr 2003 13:03:01 +0000 |
| Subject: | Re: date output | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-145769@lists.php.net to get a copy of this message | ||
thank you Justin. it's OK now, I used FROM_UNIXTIME function in MySQL.
"Justin French" <justin@indent.com.au> wrote in message
news:BAD5BB23.25ABB%justin@indent.com.au...
> on 30/04/03 6:11 PM, Sandro T. Rafael (str@qafac.com.qa) wrote:
>
> > I really don't know how to ask this question, basically a newbie
question:
> >
> > I have a database (MySQL) and one table is recording time in numeral (I
> > guess Unix time).
> >
> > how can i display it (thru PHP) in Date readable format like dd-mm-yy
> > hh-mm-ss
>
> If it's a unix timestamp, then you can pass that value to date() as the
2nd
> paramater.
>
> <?
> $stamp = 184090515; // a made up stamp
> echo date('y-m-d H:i:s', $stamp);
> ?>
>
> If it's a MySQL timestamp, I believe there are functions to return a
> formatted date from the stamp as part of the query... it might be DATE(),
> but either way, you'll need to look in the MySQL manual
> (http://www.mysql.com/doc/en/Function_Index.html) and/or ask the MySQL
list
> for more help :)
>
>
> Justin
>
>