diff options
Diffstat (limited to 'program/lib/Roundcube/rcube_db_sqlite.php')
-rw-r--r-- | program/lib/Roundcube/rcube_db_sqlite.php | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/program/lib/Roundcube/rcube_db_sqlite.php b/program/lib/Roundcube/rcube_db_sqlite.php index e548ed1f9..cef6621c2 100644 --- a/program/lib/Roundcube/rcube_db_sqlite.php +++ b/program/lib/Roundcube/rcube_db_sqlite.php @@ -94,11 +94,17 @@ class rcube_db_sqlite extends rcube_db /** * Return SQL function for current time and date * + * @param int $interval Optional interval (in seconds) to add/subtract + * * @return string SQL function to use in query */ - public function now() + public function now($interval = 0) { - return "datetime('now')"; + if ($interval) { + $add = ($interval > 0 ? '+' : '') . intval($interval) . ' seconds'; + } + + return "datetime('now'" . ($add ? ",'$add'" : "") . ")"; } /** |