TIMESTAMP

Data Type and usages

Description

A timestamp value represents an absolute point in time, independent of any time zone or convention such as daylight saving time (DST), with microsecond precision. For more information please refer to BigQuery Timestamp data type.

Grammar syntax

Name
Range

TIMESTAMP

0001-01-01 00:00:00 to 9999-12-31 23:59:59.999999 UTC

It is important to remark that BigQuery stores TIMESTAMP data in Coordinated Universal Time (UTC).

Sample Source Patterns

TIMESTAMP without time

BigQuery

CREATE OR REPLACE TABLE timestampTable
(
  COL1 TIMESTAMP
);

INSERT INTO timestampTable VALUES ('2008-12-26 15:30:00');
INSERT INTO timestampTable VALUES (TIMESTAMP'2008-12-27 18:30:00');
SELECT * FROM timestampTable;

Snowflake

TIMESTAMP with time zone

When the time zone is defined you need to use the CONVERT_TIMEZONE function to store the data in Coordinated Universal Time (UTC). Also the timezone name inside the timestamp literal is not supported by Snowflake, in that case it is necessary to use this function as well.

BigQuery

Snowflake

Last updated

Was this helpful?