A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.snowflake.com/en/sql-reference/functions/current_timestamp below:

Website Navigation


CURRENT_TIMESTAMP | Snowflake Documentation

Categories:

Context functions (General)

CURRENT_TIMESTAMP

Returns the current timestamp for the system in the local time zone.

Aliases:

LOCALTIMESTAMP , GETDATE , SYSTIMESTAMP

Syntax
CURRENT_TIMESTAMP( [ <fract_sec_precision> ] )

CURRENT_TIMESTAMP

Copy

Arguments
fract_sec_precision

This optional argument indicates the precision with which to report the time. For example, a value of 3 says to use 3 digits after the decimal point (that is, to specify the time with a precision of milliseconds).

The default precision is 9 (nanoseconds).

Valid values range from 0 - 9. However, most platforms do not support true nanosecond precision; the precision that you get might be less than the precision you specify. In practice, precision is usually approximately milliseconds (3 digits) at most.

Note

Fractional seconds are only displayed if they have been explicitly set in the TIMESTAMP_OUTPUT_FORMAT parameter for the session (e.g. 'YYYY-MM-DD HH24:MI:SS.FF').

Returns

Returns the current system time. The data type of the returned value is TIMESTAMP_LTZ.

Usage notes Examples

The examples in this section use the timestamp output format YYYY-MM-DD HH24:MI:SS.FF. To configure your session to use the same output format, run the following statement:

ALTER SESSION SET TIMESTAMP_OUTPUT_FORMAT = 'YYYY-MM-DD HH24:MI:SS.FF';

Copy

Call the CURRENT_TIMESTAMP function with different precision values

Return the current timestamp with fractional seconds precision set to 2:

SELECT CURRENT_TIMESTAMP(2);

Copy

+------------------------+
| CURRENT_TIMESTAMP(2)   |
|------------------------|
| 2024-04-17 15:41:38.29 |
+------------------------+

Return the current timestamp with fractional seconds precision set to 4:

SELECT CURRENT_TIMESTAMP(4);

Copy

+--------------------------+
| CURRENT_TIMESTAMP(4)     |
|--------------------------|
| 2024-04-17 15:42:14.2100 |
+--------------------------+

Return the current timestamp with fractional seconds precision set to the default (9):

SELECT CURRENT_TIMESTAMP;

Copy

+-------------------------------+
| CURRENT_TIMESTAMP             |
|-------------------------------|
| 2024-04-17 15:42:55.130000000 |
+-------------------------------+
Call the CURRENT_TIMESTAMP function with different TIMEZONE settings

Set the TIMEZONE parameter to America/New_York and call the CURRENT_TIMESTAMP function:

ALTER SESSION SET TIMEZONE = 'America/New_York';

SELECT CURRENT_TIMESTAMP(2);

Copy

+------------------------+
| CURRENT_TIMESTAMP(2)   |
|------------------------|
| 2025-08-11 14:16:43.57 |
+------------------------+

Set the TIMEZONE parameter to America/Los_Angeles and call the CURRENT_TIMESTAMP function:

ALTER SESSION SET TIMEZONE = 'America/Los_Angeles';

SELECT CURRENT_TIMESTAMP(2);

Copy

+------------------------+
| CURRENT_TIMESTAMP(2)   |
|------------------------|
| 2025-08-11 11:17:18.19 |
+------------------------+

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4