This documentation is related to an older version of Firebolt. For the most current documentation, see Firebolt documentation.
You are looking at the documentation for Firebolt’s redesigned date and timestamp types. These types were introduced in DB version 3.19 under the names
PGDATE
,TIMESTAMPNTZ
andTIMESTAMPTZ
, and synonymsDATE
,TIMESTAMP
andTIMESTAMPTZ
made available in DB version 3.22.If you worked with Firebolt before DB version 3.22, you might still be using the legacy date and timestamp types. Determine which types you are using by executing the query
SELECT EXTRACT(CENTURY FROM DATE '2023-03-16');
. If this query returns a result, you are using the redesigned date and timestamp types and can continue with this documentation. If this query returns an error, you are using the legacy date and timestamp types and can find legacy documentation here, or instructions to use the new types here.
CURRENT_TIMESTAMP
Returns the current timestamp as a TIMESTAMPTZ
value.
Syntax
The function can be called with or without parentheses:
CURRENT_TIMESTAMP
CURRENT_TIMESTAMP()
Return Type
TIMESTAMPTZ
Remarks
The function takes the current Unix timestamp (in the UTC time zone), and returns it as a TIMESTAMPTZ
value.
Example
The following example assumes that the current Unix timestamp is 2023-03-03 14:42:31.123456 UTC
.
SET time_zone = 'Europe/Berlin';
SELECT CURRENT_TIMESTAMP; --> 2023-03-03 15:42:31.123456+01
SET time_zone = 'America/New_York';
SELECT CURRENT_TIMESTAMP; --> 2023-03-03 09:42:31.123456-05