hi all the problem this time is TIME i put the time in the DB eg "1326995615"
how do i display it on the page like "9th Jan 2012, 6:46"
ATM i'm using
to call it back from the mysql_query but it just displays "1326995615"PHP Code:'.$row['time'].'
hi all the problem this time is TIME i put the time in the DB eg "1326995615"
how do i display it on the page like "9th Jan 2012, 6:46"
ATM i'm using
to call it back from the mysql_query but it just displays "1326995615"PHP Code:'.$row['time'].'
Are you saying you want to know how to show the date in PHP?
Daba! The Fantage-like website
Virtual World in progress.
Out of pure HTML, Javascript, and CSS. Oh, and poorly done Paint images.
yes BUT the time is coming from the database not the server clock
Get the value from the database into a variable. mysql_query(), mysql_fetch_assoc(), etc.
Then:
$mydate should be the value from the database. Note that this should be in a timestamp format. For example, right now, it is:PHP Code:date('Y'); //show the current year based on the server's clock
date('Y',$mydate); //show the year based on the timestamp of $mydate
1327001074
As for date formats, read the php.net page:
http://php.net/manual/en/function.date.php
Daniel - Freelance Web Design | <?php?> | <html>| español | Deutsch | italiano | português | català | un peu de français | some knowledge of several other languages: I can sometimes help translate here on DD | Linguistics Forum
TwitterRooms (01-19-2012)
store it in the db as a DATETIME and use something like this before storing it:
then just store $time in the column you made with type DATETIME.PHP Code:$time = date("y/m/d : H:i:s", time());
Bookmarks