aboutsummaryrefslogtreecommitdiffstats
path: root/include/dblayer/functions_pgsql.inc.php
diff options
context:
space:
mode:
authornikrou <nikrou@piwigo.org>2010-07-06 12:14:17 +0000
committernikrou <nikrou@piwigo.org>2010-07-06 12:14:17 +0000
commit804d79a625aacaac774832c1ea5230c996bb57f1 (patch)
tree91b847381200046719402256dbb82bb3c973f52b /include/dblayer/functions_pgsql.inc.php
parenta9849aa9b661cce3563b5db1013d88091da4faa6 (diff)
Bug 1766 fixed : [PostgreSQL] unkown database function UNIX_TIMESTAMP()
Add a new function pwg_db_date_to_ts() to calculate a timestamp from a date git-svn-id: http://piwigo.org/svn/trunk@6666 68402e56-0260-453c-a942-63ccdbb3a9ee
Diffstat (limited to 'include/dblayer/functions_pgsql.inc.php')
-rw-r--r--include/dblayer/functions_pgsql.inc.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/dblayer/functions_pgsql.inc.php b/include/dblayer/functions_pgsql.inc.php
index 598a699f5..3766d7cc6 100644
--- a/include/dblayer/functions_pgsql.inc.php
+++ b/include/dblayer/functions_pgsql.inc.php
@@ -596,6 +596,11 @@ function pwg_db_get_weekday($date)
return 'EXTRACT(ISODOW FROM '.$date.')::INTEGER - 1';
}
+function pwg_db_date_to_ts($date)
+{
+ return 'EXTRACT(EPOCH FROM '.$date.')';
+}
+
// my_error returns (or send to standard output) the message concerning the
// error occured for the last pgsql query.
function my_error($header, $die)