summaryrefslogtreecommitdiff
path: root/program/include/rcube_mdb2.inc
diff options
context:
space:
mode:
Diffstat (limited to 'program/include/rcube_mdb2.inc')
-rwxr-xr-xprogram/include/rcube_mdb2.inc16
1 files changed, 16 insertions, 0 deletions
diff --git a/program/include/rcube_mdb2.inc b/program/include/rcube_mdb2.inc
index 35973ad5d..54a40e796 100755
--- a/program/include/rcube_mdb2.inc
+++ b/program/include/rcube_mdb2.inc
@@ -238,6 +238,22 @@ class rcube_db
}
+ function format_date($timestamp)
+ {
+ switch($this->db_provider)
+ {
+ case 'mysqli':
+ case 'mysql':
+ return "FROM_UNIXTIME($timestamp)";
+ break;
+ case 'sqlite':
+ return "datetime('$timestamp')";
+ break;
+ default:
+ return date("Y-m-d H:i:s", $timestamp);
+ }
+ }
+
function _add_result($res, $query)
{
// sql error occured