bjeffries111 Posted April 15, 2010 Report Share Posted April 15, 2010 I am having trouble getting the date to display properly from the server, I have tried many different ways and it is just not working.My table structure is set to TIMESTAMP and when I all something new through phpmyadmin I set the time to NOW. So it posts the current time of when I created the file. Now my issue is getting it to display properly. //$timestamp = $row['uptime'];//$file = $row['uptime'];//$lastmod = date("m-d-y", time($file));$uptime = time($row['uptime']);//echo date("m-d-y",$timestamp);$select = ("SELECT * FROM photo_albums ORDER BY uptime DESC LIMIT 5 ");$result = mysql_query($select) or die(mysql_error());while($row = mysql_fetch_array($result)) {echo "<li>" ."<span class='lpBold'>".$uptime."</span><br/>" ."</li>"; You can kind of see the different methods I have tried to get the proper time, unfortunately none of them have worked.I just want the date to be displayed like: 04-14-10Thanks for the insight,Brian Link to comment Share on other sites More sharing options...
justsomeguy Posted April 15, 2010 Report Share Posted April 15, 2010 It's best to format the date when you get it from the database instead of in PHP:http://dev.mysql.com/doc/refman/5.1/en/dat...ion_date-formatYou can also use the PHP function strtotime, which may work for the default MySQL format. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now