Getting the Current Date and Time

From InterBase
Jump to: navigation, search

Go Up to Querying the Database for Current Date and Time Information


The CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP functional operators return date and time values based upon the moment of execution of a SQL statement using the server’s clock and time zone. For a single SQL statement, the same value is used for each evaluation of CURRENT_DATE, CURRENT_TIME, and CURRENT_TIMESTAMP within that statement. This means that if multiple rows are updated, as in the following statement, each data row will have the same value in the aTime column:

UPDATE aTable SET aTime = CURRENT_TIME;

Similarly, if row buffering occurs in a fetch via the remote protocol, then the value of CURRENT_TIME is based on the time of the OPEN of the cursor from the database engine, and not on the time of delivery to the client.

You can specify CURRENT_DATE, CURRENT_TIME, or CURRENT_TIMESTAMP as the default clause for a domain or column definition.

Advance To: