Oracle SYSDATE in Snowflake, Databricks and BigQuery
Snowflake has SYSDATE() but it returns a UTC TIMESTAMP_NTZ and needs parentheses. Databricks and BigQuery have no SYSDATE; use current_timestamp() or CURRENT_DATETIME(). For a date without time, use CURRENT_DATE in all three.
Oracle function: SYSDATE · Oracle docs
Equivalents
| Target | Support | Syntax | Notes | Source |
|---|---|---|---|---|
| Snowflake | Same name | SYSDATE() | Returns TIMESTAMP_NTZ in UTC, not a DATE. Parentheses are required. CURRENT_TIMESTAMP returns local session time instead. | Snowflake docs |
| Databricks | Rewrite | current_timestamp() | getdate() and now() are synonyms. Use current_date() for the date only. | Databricks docs |
| BigQuery | Rewrite | CURRENT_DATETIME([time_zone]) | DATETIME in UTC unless a time zone is passed. Use CURRENT_DATE() for the date only. | BigQuery docs |
Behavior differences to check
- Oracle SYSDATE returns the operating system time of the database server. If that server ran in a local time zone, expressions such as TRUNC(SYSDATE) mean "today in local time" and will shift by hours in a UTC warehouse.
- Oracle date arithmetic such as SYSDATE - 1 (one day earlier) does not carry over to Databricks or BigQuery; use dateadd or DATETIME_SUB with an explicit unit.
Snowflake
- Bare SYSDATE without parentheses is an error in Snowflake.
Examples
Orders placed in the last day
SELECT * FROM orders WHERE ordered_at >= SYSDATE - 1;SELECT * FROM orders WHERE ordered_at >= DATEADD(day, -1, SYSDATE());SELECT * FROM orders WHERE ordered_at >= current_timestamp() - INTERVAL 1 DAY;SELECT * FROM orders WHERE ordered_at >= DATETIME_SUB(CURRENT_DATETIME(), INTERVAL 1 DAY);