I am attempting to grab the TIME and DATE a item was last modified in an SQL database, and I got the date part to work, but I am having one hell of a time getting the time to show up.
I keep getting a really long number, that seems like it’s the # of seconds since 1/1/1970. Yeah, I could care less about that. =)
Here’s a snippet of my code..
[CODE]
// Grab the time and date it was last modified
$query = “SELECT UNIX_TIMESTAMP() AS timestamp FROM merchant ;”;
$query2 = “SELECT UNIX_TIMESTAMP() AS timestamp FROM timestamp ;”;
$result = mysql_query($query);
$result2 = mysql_query($query2);
$row_date = mysql_fetch_array($result);
$row_time = mysql_fetch_array($result2);
// Now show it off…
echo “Rates are current as of “;
echo date(“m/d/y”, $row_date[‘timestamp’]);
echo ” at “;
echo time(“hh:mm:ss”, $row_time[‘timestamp’]);
//echo
now, on the time echo, i was trying anything, so i’m pretty sure that’s wrong, but i was grabbing straws….
basically, there are records modified in a table called merchant, and i need to know when it was modified, and display it via php.
Any help is greatly appreciated!