aboutsummaryrefslogtreecommitdiffstats
path: root/include/dba/dba_pdo.php
diff options
context:
space:
mode:
Diffstat (limited to 'include/dba/dba_pdo.php')
-rwxr-xr-xinclude/dba/dba_pdo.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/include/dba/dba_pdo.php b/include/dba/dba_pdo.php
index 0279342ec..0ae69fe27 100755
--- a/include/dba/dba_pdo.php
+++ b/include/dba/dba_pdo.php
@@ -139,6 +139,15 @@ class dba_pdo extends dba_driver {
}
}
+ function str_to_date($str) {
+ if($this->driver_dbtype === 'pgsql') {
+ return "TO_TIMESTAMP($str, 'YYYY-MM-DD HH:MI:SS')";
+ }
+ else {
+ return "STR_TO_DATE($str, '%Y-%m-%d %H:%i:%s')";
+ }
+ }
+
function quote_interval($txt) {
if($this->driver_dbtype === 'pgsql') {
return "'$txt'";