Dates, times and timestamp choices
DATE stores a calendar date, TIME stores a clock time, and timestamps combine date and time with different time-zone semantics.
Understand the idea
Choose a timestamp type from the meaning of the source. A shop opening at 09:00 needs a local clock time plus its location rule. An event that occurred at one instant needs an explicit interpretation of its source zone.
| Concept | What it means |
|---|---|
| DATE / TIME | Calendar date / time of day, without a time zone. |
| TIMESTAMP_NTZ | Wall-clock date and time without zone interpretation. |
| TIMESTAMP_LTZ | An instant displayed and operated on using the session time zone. |
| TIMESTAMP_TZ | An instant with a stored offset, not a named time-zone rule. |
A concrete example
SAME_INSTANT is true. CURRENT_TIMESTAMP returns LTZ and its display depends on the session time zone. Display formatting can differ by client without changing the instant.
Remember: No. It stores an offset with the instant; keep a separate named zone when future local-time rules matter.
Explain it step by step · full theory
Understand the idea
Choose a timestamp type from the meaning of the source. A shop opening at 09:00 needs a local clock time plus its location rule. An event that occurred at one instant needs an explicit interpretation of its source zone.
LTZ uses the session TIMEZONE for presentation. TZ retains an offset but not the full named zone and its future daylight-saving rules. NTZ alone cannot tell you which instant a local clock reading represents. Prefer explicit type names over the configurable TIMESTAMP alias.
Words used in this lesson
- DATE / TIME
- Calendar date / time of day, without a time zone.
- TIMESTAMP_NTZ
- Wall-clock date and time without zone interpretation.
- TIMESTAMP_LTZ
- An instant displayed and operated on using the session time zone.
- TIMESTAMP_TZ
- An instant with a stored offset, not a named time-zone rule.
See how it works
Choose a step to explore the idea at your own pace.
Open the interactive explanation
Dates, times and timestamp choices
Choose the input
DATE stores a calendar date, TIME stores a clock time, and timestamps combine date and time with different time-zone semantics.
Automatic playback is off for reduced motion. Select any step or use Previous and Next. Illustrations explain behavior; they are not live measurements.
Read the complete diagram explanation
- Choose the input
DATE stores a calendar date, TIME stores a clock time, and timestamps combine date and time with different time-zone semantics.
- Apply the SQL
Choose a timestamp type from the meaning of the source. A shop opening at 09:00 needs a local clock time plus its location rule. An event that occurred at one instant needs an explicit interpretation of its source zone.
- Explain the result
No. It stores an offset with the instant; keep a separate named zone when future local-time rules matter.
Try the SQL or command
Read → predict → run in your learning environment → compare. You can also learn by reading without an account.
New to SQL? Where to run it and how to read it
A query is a question written in SQL. Snowflake runs it and returns a result table. This website shows examples; it does not connect to your account.
- No account yet? Read and predict the output first. Follow the account and Snowsight lesson when you are ready.
- For SQL practice, use a learning account in Snowsight and select an authorized role and warehouse. A role determines permissions; a warehouse supplies processing power. Follow the example’s database/schema setup when it refers to stored objects.
- Read the entire example, including comments beginning with
--. Run the selected statement or labeled block in the stated order. Examples labeled Python, shell or HTTP belong in that client, not in a SQL editor. - Compare values and row counts with the explained result. If an example deliberately causes an error, follow its rollback and cleanup steps before continuing.
- SELECT / FROM
- Choose the values to return / identify their input.
- VALUES / COLUMN1
- VALUES supplies tiny example rows. COLUMN1 means their first column, COLUMN2 their second.
- AS / WITH
- AS gives a result a readable name. WITH names a temporary query step within one statement.
- NULL / ::
- NULL means missing or unknown. The :: notation converts a value to a named data type.
- Session
- One connection and its settings. Keep related transaction steps in the same session.
- Database.schema.table
- A full address for stored data. It is separate from the warehouse that processes queries.
Need the L2_OBJECTS_LAB setup? Open the first database-object lesson →
Help with common practice errors
- No active warehouse: select a warehouse your role can use. Do not assume you need to create a new one.
- Object missing or not authorized: check the full name, required setup and active role. Ask the account owner for access if needed.
- Object already exists: setup may already have run. Read the current state or choose a fresh lab name consistently; do not add OR REPLACE blindly.
- Different result: check whether an earlier INSERT or UPDATE changed the data. VALUES examples provide their own fresh input for each statement.
Before running this lesson
Use an authorized learning account and warehouse. VALUES examples need no stored tables. Object-changing examples use separate disposable tables in L2_OBJECTS_LAB.SALES from the first lesson; run each setup once with a fresh name.
Compare two representations of one instant
SELECT DATE '2026-01-15' AS DAY, TIME '09:30:00' AS CLOCK,
'2026-01-15 09:30:00'::TIMESTAMP_NTZ AS LOCAL_CLOCK,
'2026-01-15 09:30:00 +0530'::TIMESTAMP_TZ
= '2026-01-15 04:00:00 +0000'::TIMESTAMP_TZ AS SAME_INSTANT;
SELECT CURRENT_TIMESTAMP() AS SESSION_TIME;What to expect and why
SAME_INSTANT is true. CURRENT_TIMESTAMP returns LTZ and its display depends on the session time zone. Display formatting can differ by client without changing the instant.
Check your understanding
Choose an answer, then check your reasoning. This is practice, not a scored test.
Try it yourself
Does TIMESTAMP_TZ preserve the full named time zone?
Compare your reasoning
No. TIMESTAMP_TZ stores an offset with the instant, not the named time zone. Keep a named zone separately when future local-time rules matter.