diff options
author | nikrou <nikrou@piwigo.org> | 2010-06-22 21:01:47 +0000 |
---|---|---|
committer | nikrou <nikrou@piwigo.org> | 2010-06-22 21:01:47 +0000 |
commit | 1661af7f3f10bd303d2a1e71054fe9ba57954604 (patch) | |
tree | 2f3fd38ea5b26712c3641bd5e15f45aff74001c7 /include/dblayer/functions_sqlite.inc.php | |
parent | 7629b2723a4e8691cef8c5056c300ac3b3143ce7 (diff) |
Bug 1738 fixed : merge from trunk
hour function doesn't exists for database other than mysql.
git-svn-id: http://piwigo.org/svn/branches/2.1@6579 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to '')
-rw-r--r-- | include/dblayer/functions_sqlite.inc.php | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/include/dblayer/functions_sqlite.inc.php b/include/dblayer/functions_sqlite.inc.php index 72f539c92..7a33b09a2 100644 --- a/include/dblayer/functions_sqlite.inc.php +++ b/include/dblayer/functions_sqlite.inc.php @@ -55,7 +55,6 @@ 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); @@ -514,6 +513,11 @@ function pwg_db_get_recent_period($period, $date='CURRENT_DATE') return $d; } +function pwg_db_get_hour($date) +{ + return 'strftime(\'%H\', '.$date.')'; +} + function pwg_db_get_date_YYYYMM($date) { return 'strftime(\'%Y%m\','.$date.')'; @@ -583,11 +587,6 @@ 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(); |