mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-24 15:48:55 +01:00
* PostgreSQL: fixed SQL error using egw_db::unix_timestamp(): No function matches the given name and argument types
This commit is contained in:
parent
6cedec1768
commit
e5fe9bc578
@ -1248,7 +1248,7 @@ class egw_db
|
|||||||
return "UNIX_TIMESTAMP($expr)";
|
return "UNIX_TIMESTAMP($expr)";
|
||||||
|
|
||||||
case 'pgsql':
|
case 'pgsql':
|
||||||
return "DATE_PART('epoch',$expr)";
|
return "EXTRACT(EPOCH FROM CAST($expr AS TIMESTAMP))";
|
||||||
|
|
||||||
case 'mssql':
|
case 'mssql':
|
||||||
return "DATEDIFF(second,'1970-01-01',($expr))";
|
return "DATEDIFF(second,'1970-01-01',($expr))";
|
||||||
@ -1270,7 +1270,7 @@ class egw_db
|
|||||||
return "FROM_UNIXTIME($expr)";
|
return "FROM_UNIXTIME($expr)";
|
||||||
|
|
||||||
case 'pgsql':
|
case 'pgsql':
|
||||||
return "(timestamp with time zone 'epoch' + ($expr) * interval '1 sec')";
|
return "(TIMESTAMP WITH TIME ZONE 'epoch' + ($expr) * INTERVAL '1 sec')";
|
||||||
|
|
||||||
case 'mssql': // we use date(,0) as we store server-time
|
case 'mssql': // we use date(,0) as we store server-time
|
||||||
return "DATEADD(second,($expr),'".date('Y-m-d H:i:s',0)."')";
|
return "DATEADD(second,($expr),'".date('Y-m-d H:i:s',0)."')";
|
||||||
|
Loading…
Reference in New Issue
Block a user