Bitrix Site Manager

CDatabase::CurrentDateFunction

string
CDatabase::CurrentDateFunction()

The method CurrentDateFunction is used to obtain the SQL function returning the current date: CURRENT_DATE for MySQL or TRUNC(SYSDATE) for Oracle.

Parameters


No parameters.

See Also

Example



<?
$strSql = "UPDATE my_table SET DATE_CHANGE=".$DB->CurrentDateFunction()." WHERE ID=45";
$Query($strSql, false, "FILE: ".__FILE__."<br>LINE: ".__LINE__);
?>
<?
$strSql = "
    SELECT 
        ID
    FROM 
        my_table
    WHERE 
        DATE_CREATE <= ".$DB->CurrentDateFunction()."
    ";
$rs = $DB->Query($strSql, false, $err_mess.__LINE__);
?>