|
|
@ -410,6 +410,25 @@ class rcube_db
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
|
|
|
* Return SQL function for current time and date
|
|
|
|
|
|
|
|
*
|
|
|
|
|
|
|
|
* @return string SQL function to use in query
|
|
|
|
|
|
|
|
* @access public
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
function now()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
switch($this->db_provider)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
case 'mssql':
|
|
|
|
|
|
|
|
return "getdate()";
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
|
|
|
return "now()";
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* Return SQL statement to convert a field value into a unix timestamp
|
|
|
|
* Return SQL statement to convert a field value into a unix timestamp
|
|
|
|
*
|
|
|
|
*
|
|
|
@ -425,6 +444,9 @@ class rcube_db
|
|
|
|
return "EXTRACT (EPOCH FROM $field)";
|
|
|
|
return "EXTRACT (EPOCH FROM $field)";
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
case 'mssql':
|
|
|
|
|
|
|
|
return "datediff(s, '1970-01-01 00:00:00', $field)";
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return "UNIX_TIMESTAMP($field)";
|
|
|
|
return "UNIX_TIMESTAMP($field)";
|
|
|
|
}
|
|
|
|
}
|
|
|
|