aboutsummaryrefslogtreecommitdiffstats
path: root/include/dblayer/functions_sqlite.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2010-06-04 19:39:02 +0000
committernikrou <nikrou@piwigo.org>2010-06-04 19:39:02 +0000
commite49ff390d34685200cb2148aeded472c56bf1b68 (patch)
tree3085b2b1b2dbe35832db17a3650f46cc447efce5 /include/dblayer/functions_sqlite.inc.php
parentcb00a22449e6f83c58da275dfcc5984b6100b964 (diff)
Bug 1717 fixed : SQLite: access failure on Admin > Tools > History
hour function doesn't exists Merge from trunk. git-svn-id: http://piwigo.org/svn/branches/2.1@6464 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/dblayer/functions_sqlite.inc.php')
-rw-r--r--include/dblayer/functions_sqlite.inc.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/dblayer/functions_sqlite.inc.php b/include/dblayer/functions_sqlite.inc.php
index 9de81868d..72f539c92 100644
--- a/include/dblayer/functions_sqlite.inc.php
+++ b/include/dblayer/functions_sqlite.inc.php
@@ -55,6 +55,7 @@ function pwg_db_connect($host, $user, $password, $database)
}
$link->createFunction('now', 'pwg_now', 0);
+ $link->createFunction('hour', 'pwg_hour', 1);
$link->createFunction('unix_timestamp', 'pwg_unix_timestamp', 0);
$link->createFunction('md5', 'md5', 1);
$link->createFunction('if', 'pwg_if', 3);
@@ -582,6 +583,11 @@ function pwg_now()
return date('Y-m-d H:i:s');
}
+function pwg_hour($datetime)
+{
+ return strftime('%H', $datetime);
+}
+
function pwg_unix_timestamp()
{
return time();