ReferenceApplies to: Unified engine deployments
Temporal operations depend on the input type and session time zone. DATE is a calendar value; TIMESTAMP and TIMESTAMP_NTZ have different zone semantics. The examples use date_dim and UTC.
EXTRACT currently lowers to an unregistered function. Use DATE_PART for these fields.
Truncation and conversion
The runnable truncation example uses TIMESTAMP_NTZ. Zone-aware DATE_TRUNC can require the unavailable ICU extension in Native execution.
date_trunc(unit, timestamp) returns a timestamp truncated to the named unit. CAST changes a supported temporal representation. Parsing or formatting text requires a function and format accepted by the current engine; format-token languages differ across SQL systems.
Current date and time
CURRENT_DATE and CURRENT_TIMESTAMP use session semantics. Their values change over time, so examples should check their types and relationship to the session rather than a fixed date.
Intervals
An interval represents a duration or calendar offset. Calendar months differ in length, and daylight-saving transitions can affect zone-aware arithmetic. Validate the supported interval form and unit for the expression and backend. Use explicit casts to avoid mixing text with timestamps implicitly.
Changing spark.sql.session.timeZone affects subsequent operations in the same session. A zone can be recognized by the session yet need an installed backend time-zone extension for execution beyond UTC.Last modified on November 4, 2026