Skip to main content

at_timezone

Returns the timestamp specified in timestamp with the time zone converted from the session time zone to the time zone specified in zone with precision p. In the following example, the session time zone is set to America/New_York, which is three hours ahead of America/Los_Angeles. Supported Signatures
๐Ÿ”— Official Documentation

current_date

Returns the current date as of the start of the query. Examples:
examples.sql
Supported Signatures
Note: current_date() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

current_time

Returns the current time with time zone as of the start of the query. Examples:
examples.sql
Supported Signatures
Note: current_time() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

current_timestamp

Returns the current timestamp with time zone as of the start of the query, with 3 digits of subsecond precision, Examples:
examples.sql
Supported Signatures
Note: current_timestamp() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

current_timezone

Returns the current time zone in the format defined by IANA (e.g., America/Los_Angeles) or as fixed offset from UTC (e.g., +08.35) Supported Signatures
Note: current_timezone() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

date

This date(x) is an alias for CAST(x AS date). Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

date_add

Adds an interval value of type unit to timestamp. Subtraction can be performed by using a negative value. Supported Signatures
๐Ÿ”— Official Documentation

date_diff

Takes a unit, timestamp1, and timestamp2. Returns timestamp2 - timestamp1 expressed in terms of unit. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

date_format

Formats timestamp as a string using format. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

date_parse

Parses string into a timestamp using format. Supported Signatures
๐Ÿ”— Official Documentation

date_trunc

Returns the date x truncated to unit. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

day

Returns the day of the month from x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

day_of_month

This is an alias for day(). Supported Signatures
๐Ÿ”— Official Documentation

day_of_week

Returns the ISO day of the week from x. The value ranges from 1 (Monday) to 7 (Sunday). Supported Signatures
๐Ÿ”— Official Documentation

day_of_year

Returns the day of the year from x. The value ranges from 1 to 366. Supported Signatures
๐Ÿ”— Official Documentation

dow

This is an alias for day_of_week(). Supported Signatures
๐Ÿ”— Official Documentation

doy

This is an alias for day_of_year(). Supported Signatures
๐Ÿ”— Official Documentation

format_datetime

Formats timestamp as a string using format. Supported Signatures
๐Ÿ”— Official Documentation

from_iso8601_date

Parses the ISO 8601 formatted date string into a date. The date can be a calendar date, a week date using ISO week numbering, or year and day of year combined. Supported Signatures
๐Ÿ”— Official Documentation

from_iso8601_timestamp

Parses the ISO 8601 formatted date string, optionally with time and time zone, into a timestamp(3) with time zone. The time defaults to 00.00.00.000, and the time zone defaults to the session time zone. Supported Signatures
๐Ÿ”— Official Documentation

from_iso8601_timestamp_nanos

Parses the ISO 8601 formatted date and time string. The time zone defaults to the session time zone. Supported Signatures
๐Ÿ”— Official Documentation

from_unixtime

Returns the UNIX timestamp unixtime as a timestamp with time zone. unixtime is the number of seconds since 1970-01-01 00.00.00 UTC. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

from_unixtime_nanos

Returns the UNIX timestamp unixtime as a timestamp with time zone. unixtime is the number of nanoseconds since 1970-01-01 00.00.00.000000000 UTC. Supported Signatures
๐Ÿ”— Official Documentation

hour

Returns the hour of the day from x. The value ranges from 0 to 23. Supported Signatures
๐Ÿ”— Official Documentation

human_readable_seconds

Formats the double value of seconds into a human readable string containing weeks, days, hours, minutes, and seconds. Supported Signatures
๐Ÿ”— Official Documentation

last_day_of_month

Returns the last day of the month. Supported Signatures
๐Ÿ”— Official Documentation

localtime

Returns the current time as of the start of the query. Supported Signatures
Note: localtime() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

localtimestamp

Returns the current timestamp as of the start of the query, with 3 digits of subsecond precision. Supported Signatures
Note: localtimestamp() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

millisecond

Returns the millisecond of the second from x. Supported Signatures
๐Ÿ”— Official Documentation

minute

Returns the minute of the hour from x. Supported Signatures
๐Ÿ”— Official Documentation

month

Returns the month of the year from x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

now

This is an alias for current_timestamp. Examples:
examples.sql
Supported Signatures
Note: now() is stable, i.e. might return a different value for a different query execution. ๐Ÿ”— Official Documentation

parse_datetime

Parses string into a timestamp with time zone using format. Supported Signatures
๐Ÿ”— Official Documentation

parse_duration

Parses string of format value unit into an interval, where value is fractional number of unit values. Supported Signatures
๐Ÿ”— Official Documentation

quarter

Returns the quarter of the year from x. The value ranges from 1 to 4. Supported Signatures
๐Ÿ”— Official Documentation

second

Returns the second of the minute from x. Supported Signatures
๐Ÿ”— Official Documentation

timezone_hour

Returns the hour of the time zone offset from timestamp. Supported Signatures
๐Ÿ”— Official Documentation

timezone_minute

Returns the minute of the time zone offset from timestamp. Supported Signatures
๐Ÿ”— Official Documentation

to_iso8601

Formats x as an ISO 8601 string. x can be date, timestamp, or timestamp with time zone. Supported Signatures
๐Ÿ”— Official Documentation

to_milliseconds

Returns the day-to-second interval as milliseconds. Supported Signatures
๐Ÿ”— Official Documentation

to_unixtime

Returns timestamp as a UNIX timestamp. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

week

Returns the ISO week of the year from x. The value ranges from 1 to 53. Supported Signatures
๐Ÿ”— Official Documentation

week_of_year

This is an alias for week(). Supported Signatures
๐Ÿ”— Official Documentation

with_timezone

Returns the timestamp specified in timestamp with the time zone specified in zone with precision p. Supported Signatures
๐Ÿ”— Official Documentation

year

Returns the year from x. Examples:
examples.sql
Supported Signatures
๐Ÿ”— Official Documentation

year_of_week

Returns the year of the ISO week from x. Supported Signatures
๐Ÿ”— Official Documentation

yow

This is an alias for year_of_week(). Supported Signatures
๐Ÿ”— Official Documentation