> ## Documentation Index
> Fetch the complete documentation index at: https://docs.e6data.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Equivalent functions and operators

> Functions and operators in Athena, BigQuery, Databricks, Presto, Redshift and Snowflake, and their e6data equivalents.

Pick the engine you're coming from. Each table lists a function or expression in that engine and the e6data equivalent. For full syntax, open the function in the [SQL function reference](https://docs.e6data.com/query/sql/functions).

**Athena**

| Athena | e6data |
| - | - |
| current\_date | current\_date() |
| current\_date AT TIME ZONE timezone | current\_date(timezone) |
| current\_timestamp | current\_timestamp() |
| current\_timestamp AT TIME ZONE timezone | current\_timestamp(timezone) |
| date\_trunc('month', date) + interval '1' month - interval '1' day | last\_day( \<date/datetime expr> ) |
| DATE\_TRUNC('unit', timestamp) | date\_trunc(unit, \<expr> ) |
| date\_add(unit, value, timestamp) | date\_add(unit, value, \<date expr>) |
| date\_diff(unit, timestamp1, timestamp2) | date\_diff( \<date expr1>, \<date expr2>, \[\<unit> optional]) |
| date\_add(unit, value, timestamp) | timestamp\_add(unit, value, \<timestamp expr>) |
| date\_diff(unit, timestamp1, timestamp2) | timestamp\_diff(\<timestamp expr1>, \<timestamp expr2>, unit) |
| to\_timestamp(string, format) | to\_timestamp( \<expr> ) |
| \<exp> AT TIME ZONE \<time zone> | datetime(\<expr>, \<time zone>) |
| from\_unixtime(unixtime) | from\_unixtime(\<expr>, \[\<unit> optional]) |
| to\_unixtime(expr) | to\_unix\_timestamp( \<expr> ) |
| format\_datetime(timestamp, format) | format\_date( \<expr>, format) |
| format\_datetime(timestamp, format) | format\_timestamp(\<expr>, format) |
| extract(field FROM x) | extract( unit FROM \<datetime expr>) |
| timestamp '2012-10-31 01:00' + interval '1' month | current\_timestamp + interval '8' minute |
| array\_join(x, delimiter, null\_replacement) | array\_to\_string( \<expr>, delimiter) |
| json\_extract\_scalar(json, json\_path) | json\_value( \<json expr>, \<json-path>) |

**BigQuery**

| BigQuery | e6data |
| - | - |
| APPROX\_QUANTILES( expression, number) | approx\_quantiles( \<expr>, number) |
| current\_date() | current\_date() |
| CURRENT\_DATE(\[time\_zone]) | current\_date(timezone) |
| CURRENT\_TIMESTAMP() | current\_timestamp() |
| DATETIME(CURRENT\_TIMESTAMP(), "America/Los\_Angeles") | current\_timestamp(timezone) |
| last\_day( \<date/datetime expr> ) | last\_day( \<date/datetime expr> ) |
| DATE\_TRUNC(date\_expression, unit) | date\_trunc(unit, \<expr> ) |
| DATE\_ADD(date\_expression, INTERVAL int64\_expression date\_part) | date\_add(unit, value, \<date expr>) |
| DATE\_DIFF(date\_expression\_a, date\_expression\_b, date\_part) | date\_diff( \<date expr1>, \<date expr2>, \[\<unit> optional]) |
| DATETIME\_ADD(datetime\_expression, INTERVAL int64\_expression part) | timestamp\_add(unit, value, \<timestamp expr>) |
| DATETIME\_DIFF(datetime\_expression\_a, datetime\_expression\_b, part) | timestamp\_diff(\<timestamp expr1>, \<timestamp expr2>, unit) |
| TIMESTAMP(string\_expression\[, time\_zone]) | to\_timestamp( \<expr> ) |
| DATETIME(timestamp\_expression \[, time\_zone]) | datetime(\<expr>, \<time zone>) |
| format\_timestamp("%Y-%m-%d", timestamp\_seconds(time)) | from\_unixtime(\<expr>, \[\<unit> optional]) |
| UNIX\_SECONDS(expr) | to\_unix\_timestamp( \<expr> ) |
| FORMAT\_DATE(format\_string, date\_expr) | format\_date( \<expr>, format) |
| FORMAT\_DATETIME(format\_string, datetime\_expression) | format\_timestamp(\<expr>, format) |
| EXTRACT(part FROM date\_expression) | extract( unit FROM \<datetime expr>) |
| current\_timestamp + interval '8' minute | current\_timestamp + interval '8' minute |
| ARRAY\_TO\_STRING(array\_expression, delimiter\[, null\_text]) | array\_to\_string( \<expr>, delimiter) |
| JSON\_VALUE(json\_expr\[, json\_path]) | json\_value( \<json expr>, \<json-path>) |

**Databricks**

| Databricks | e6data |
| - | - |
| current\_date() | current\_date() |
| from\_utc\_timestamp(current\_date(),timezone) | current\_date(timezone) |
| current\_timestamp() | current\_timestamp() |
| from\_utc\_timestamp(current\_timestamp(),timezone) | current\_timestamp(timezone) |
| last\_day(expr) | last\_day( \<date/datetime expr> ) |
| date\_trunc(unit, expr) | date\_trunc(unit, \<expr> ) |
| dateadd(unit, value, expr) | date\_add(unit, value, \<date expr>) |
| datediff(endDate, startDate) | date\_diff( \<date expr1>, \<date expr2>, \[\<unit> optional]) |
| timestampadd(unit, value, expr) | timestamp\_add(unit, value, \<timestamp expr>) |
| timestampdiff(unit, start, end) | timestamp\_diff(\<timestamp expr1>, \<timestamp expr2>, unit) |
| to\_timestamp(expr \[, fmt] ) | to\_timestamp( \<expr> ) |
| from\_utc\_timestamp(expr, timeZone) | datetime(\<expr>, \<time zone>) |
| from\_unixtime(unixTime \[, fmt]) | from\_unixtime(\<expr>, \[\<unit> optional]) |
| to\_unix\_timestamp(expr \[, fmt] ) | to\_unix\_timestamp( \<expr> ) |
| date\_format(expr, fmt) | format\_date( \<expr>, format) |
| date\_format(expr, fmt) | format\_timestamp(\<expr>, format) |
| extract(field FROM source) | extract( unit FROM \<datetime expr>) |
| date\_part(field, expr) | datepart( unit, \<expr> ) |
| caldate + interval '1 second' | current\_timestamp + interval '8' minute |
| array\_join(array, delimiter \[, nullReplacement]) | array\_to\_string( \<expr>, delimiter) |

**Presto**

| Presto | e6data |
| - | - |
| current\_date | current\_date() |
| current\_date AT TIME ZONE timezone | current\_date(timezone) |
| current\_timestamp | current\_timestamp() |
| current\_timestamp AT TIME ZONE timezone | current\_timestamp(timezone) |
| last\_day\_of\_month(x) | last\_day( \<date/datetime expr> ) |
| date\_trunc(unit, x) | date\_trunc(unit, \<expr> ) |
| date\_add(unit, value, timestamp) | date\_add(unit, value, \<date expr>) |
| date\_diff(unit, timestamp1, timestamp2) | date\_diff( \<date expr1>, \<date expr2>, \[\<unit> optional]) |
| date\_add(unit, value, timestamp) | timestamp\_add(unit, value, \<timestamp expr>) |
| date\_diff(unit, timestamp1, timestamp2) | timestamp\_diff(\<timestamp expr1>, \<timestamp expr2>, unit) |
| to\_timestamp(string, format) | to\_timestamp( \<expr> ) |
| \<exp> AT TIME ZONE \<time zone> | datetime(\<expr>, \<time zone>) |
| from\_unixtime(unixtime) | from\_unixtime(\<expr>, \[\<unit> optional]) |
| to\_unixtime(expr) | to\_unix\_timestamp( \<expr> ) |
| format\_datetime(timestamp, format) | format\_date( \<expr>, format) |
| format\_datetime(timestamp, format) | format\_timestamp(\<expr>, format) |
| extract(field FROM x) | extract( unit FROM \<datetime expr>) |
| timestamp '2012-10-31 01:00' + interval '1' month | current\_timestamp + interval '8' minute |
| array\_join(x, delimiter, null\_replacement) | array\_to\_string( \<expr>, delimiter) |
| json\_extract\_scalar(json, json\_path) | json\_value( \<json expr>, \<json-path>) |

**Redshift**

| Redshift | e6data |
| - | - |
| current\_date | current\_date() |
| current\_date AT TIME ZONE timezone | current\_date(timezone) |
| current\_timestamp | current\_timestamp() |
| current\_timestamp AT TIME ZONE timezone | current\_timestamp(timezone) |
| LAST\_DAY ( \{ date \| timestamp } ) | last\_day( \<date/datetime expr> ) |
| DATE\_TRUNC('unit', timestamp) | date\_trunc(unit, \<expr> ) |
| DATEADD( datepart, interval, \{date\|time\|timetz\|timestamp} ) | date\_add(unit, value, \<date expr>) |
| DATEDIFF ( datepart, \{date\|time\|timetz\|timestamp}, \{date\|time\|timetz\|timestamp} ) | date\_diff( \<date expr1>, \<date expr2>, \[\<unit> optional]) |
| DATEADD( datepart, interval, \{date\|time\|timetz\|timestamp} ) | timestamp\_add(unit, value, \<timestamp expr>) |
| DATEDIFF ( datepart, \{date\|time\|timetz\|timestamp}, \{date\|time\|timetz\|timestamp} ) | timestamp\_diff(\<timestamp expr1>, \<timestamp expr2>, unit) |
| to\_timestamp (timestamp, format) | to\_timestamp( \<expr> ) |
| \<exp> AT TIME ZONE \<time zone> | datetime(\<expr>, \<time zone>) |
| timestamp 'epoch' + CAST(your\_timestamp\_column AS BIGINT)/1000 \* interval '1 second' | from\_unixtime(\<expr>, \[\<unit> optional]) |
| extract(epoch from CURRENT\_DATE) | to\_unix\_timestamp( \<expr> ) |
| TO\_CHAR (timestamp\_expression \| numeric\_expression , 'format') | format\_date( \<expr>, format) |
| TO\_CHAR (timestamp\_expression \| numeric\_expression , 'format') | format\_timestamp(\<expr>, format) |
| EXTRACT ( datepart FROM \{ TIMESTAMP 'literal' \| timestamp \| time \| timetz } ) | extract( unit FROM \<datetime expr>) |
| DATE\_PART(datepart, \{date\|timestamp}) | datepart( unit, \<expr> ) |
| caldate + interval '1 second' | current\_timestamp + interval '8' minute |
| json\_extract\_path\_text('json\_string', 'path\_elem' \[,'path\_elem'\[, …] ] \[, null\_if\_invalid ] ) | json\_value( \<json expr>, \<json-path>) |

**Snowflake**

| Snowflake | e6data |
| - | - |
| current\_date() | current\_date() |
| convert\_timezone('UTC','timestamp', current\_date()) | current\_date(timezone) |
| current\_timestamp() | current\_timestamp() |
| convert\_timezone('UTC','timestamp', current\_timestamp()) | current\_timestamp(timezone) |
| LAST\_DAY( \<date\_or\_time\_expr> \[ , \<date\_part> ] ) | last\_day( \<date/datetime expr> ) |
| DATE\_TRUNC( \<date\_or\_time\_part>, \<date\_or\_time\_expr> ) | date\_trunc(unit, \<expr> ) |
| DATEADD( \<date\_or\_time\_part>, \<value>, \<date\_or\_time\_expr> ) | date\_add(unit, value, \<date expr>) |
| DATEDIFF( \<date\_or\_time\_part>, \<date\_or\_time\_expr1>, \<date\_or\_time\_expr2> ) | date\_diff( \<date expr1>, \<date expr2>, \[\<unit> optional]) |
| TIMESTAMPADD( \<date\_or\_time\_part> , \<time\_value> , \<date\_or\_time\_expr> ) | timestamp\_add(unit, value, \<timestamp expr>) |
| TIMESTAMPDIFF( \<date\_or\_time\_part> , \<date\_or\_time\_expr1> , \<date\_or\_time\_expr2> ) | timestamp\_diff(\<timestamp expr1>, \<timestamp expr2>, unit) |
| to\_timestamp( \<expr> ) | to\_timestamp( \<expr> ) |
| CONVERT\_TIMEZONE( \<target\_tz> , \<source\_timestamp> ) | datetime(\<expr>, \<time zone>) |
| TO\_TIMESTAMP( epoch\_sec ) | from\_unixtime(\<expr>, \[\<unit> optional]) |
| date\_part('epoch\_second',current\_timestamp()) | to\_unix\_timestamp( \<expr> ) |
| TO\_VARCHAR( \<date\_or\_time\_expr> \[, '\<format>' ] ) | format\_date( \<expr>, format) |
| TO\_VARCHAR( \<date\_or\_time\_expr> \[, '\<format>' ] ) | format\_timestamp(\<expr>, format) |
| EXTRACT( \<date\_or\_time\_part> FROM \<date\_or\_time\_expr> ) | extract( unit FROM \<datetime expr>) |
| DATE\_PART( \<date\_or\_time\_part> , \<date\_or\_time\_expr> ) | datepart( unit, \<expr> ) |
| caldate + interval '1 second' | current\_timestamp + interval '8' minute |
| ARRAY\_TO\_STRING( \<array> , \<separator\_string> ) | array\_to\_string( \<expr>, delimiter) |
| JSON\_EXTRACT\_PATH\_TEXT( \<column\_identifier> , '\<path\_name>' ) | json\_value( \<json expr>, \<json-path>) |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.