aboutsummaryrefslogtreecommitdiffstats
path: root/include/dblayer/functions_pdo-sqlite.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2010-06-04 19:36:56 +0000
committernikrou <nikrou@piwigo.org>2010-06-04 19:36:56 +0000
commitfd0f465c59415c73bf6cf926a73804b32807c969 (patch)
tree36f75048d8b64de402a555961f542f187b929a53 /include/dblayer/functions_pdo-sqlite.inc.php
parent8a1f11a2942f9e20b39fd4ae53a37ee024d374cf (diff)
Fix bug 1717 : SQLite: access failure on Admin > Tools > History
hour function doesn't exists git-svn-id: http://piwigo.org/svn/trunk@6463 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r--include/dblayer/functions_pdo-sqlite.inc.php6
1 files changed, 6 insertions, 0 deletions
diff --git a/include/dblayer/functions_pdo-sqlite.inc.php b/include/dblayer/functions_pdo-sqlite.inc.php
index a1f0a7833..365083f0c 100644
--- a/include/dblayer/functions_pdo-sqlite.inc.php
+++ b/include/dblayer/functions_pdo-sqlite.inc.php
@@ -46,6 +46,7 @@ function pwg_db_connect($host, $user, $password, $database)
}
$link->sqliteCreateFunction('now', 'pwg_now', 0);
+ $link->sqliteCreateFunction('hour', 'pwg_hour', 1);
$link->sqliteCreateFunction('unix_timestamp', 'pwg_unix_timestamp', 0);
$link->sqliteCreateFunction('md5', 'md5', 1);
$link->sqliteCreateFunction('if', 'pwg_if', 3);
@@ -570,6 +571,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();