Re: date output

From: Date: Wed, 30 Apr 2003 06:40:52 +0000
Subject: Re: date output
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-145736@lists.php.net to get a copy of this message
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

« previous php.general (#145736) next »