date()/time() returning incorrect time?
Posted: Mon Jan 05, 2009 10:36 pm
Okay, I have this code that simply sets a cell to the current time using the time() function:
I set the value at 20:29, but the value put into mysql is 20:01, and for some reason the date will never update. It is always set to 20:01
site_dtformat = M jS Y H:m a
last_seen = 1231216344
output = Jan 5th 2009 20:01 pm
Code: Select all
function updateLastSeen($id)
{
global $site_db;
$time = time();
$query = sprintf("UPDATE r_users SET last_seen='%s' WHERE id='%s' LIMIT 1",
$site_db->escape($time), $site_db->escape($id));
$site_db->query($query);
return $time;
}Code: Select all
<?=date($_SESSION['site_dtformat'], $user['last_seen'])?>last_seen = 1231216344
output = Jan 5th 2009 20:01 pm