use $db->getCurrentTimestamp() instead of mktime

This commit is contained in:
Uwe Steinmann 2015-09-22 07:51:13 +02:00
parent daa72a9ca3
commit 904cd7a857

View File

@ -49,7 +49,7 @@ function addEvent($from, $to, $name, $comment ){
global $db,$user;
$queryStr = "INSERT INTO tblEvents (name, comment, start, stop, date, userID) VALUES ".
"(".$db->qstr($name).", ".$db->qstr($comment).", ".(int) $from.", ".(int) $to.", ".mktime().", ".$user->getID().")";
"(".$db->qstr($name).", ".$db->qstr($comment).", ".(int) $from.", ".(int) $to.", ".$db->getCurrentTimestamp().", ".$user->getID().")";
$ret = $db->getResult($queryStr);
return $ret;
@ -76,7 +76,7 @@ function editEvent($id, $from, $to, $name, $comment ){
global $db;
$queryStr = "UPDATE tblEvents SET start = " . (int) $from . ", stop = " . (int) $to . ", name = " . $db->qstr($name) . ", comment = " . $db->qstr($comment) . ", date = " . mktime() . " WHERE id = ". (int) $id;
$queryStr = "UPDATE tblEvents SET start = " . (int) $from . ", stop = " . (int) $to . ", name = " . $db->qstr($name) . ", comment = " . $db->qstr($comment) . ", date = " . $db->getCurrentTimestamp() . " WHERE id = ". (int) $id;
$ret = $db->getResult($queryStr);
return $ret;
}