Date

Current date

Returns the current date –> learn more

CURRENT_DATE([@time_zone])

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@time_zone

any of: ACDT, ACST, ACT, ACT, ACWST, ADT, AEDT, AEST, AFT, AKDT, AKST, AMST, AMT, AMT, ART, AST, AST, AWST, AZOST, AZOT, AZT, BDT, BIOT, BIT, BOT, BRST, BRT, BST, BST, BST, BTT, CAT, CCT, CDT, CDT, CEST, CET, CHADT, CHAST, CHOT, CHOST, CHST, CHUT, CIST, CIT, CKT, CLST, CLT, COST, COT, CST, CST, CST, CT, CVT, CWST, CXT, DAVT, DDUT, DFT, EASST, EAST, EAT, ECT, ECT, EDT, EEST, EET, EGST, EGT, EIT, EST, FET, FJT, FKST, FKT, FNT, GALT, GAMT, GET, GFT, GILT, GIT, GMT, GST, GST, GYT, HDT, HAEC, HST, HKT, HMT, HOVST, HOVT, ICT, IDLW, IDT, IOT, IRDT, IRKT, IRST, IST, IST, IST, JST, KALT, KGT, KOST, KRAT, KST, LHST, LHST, LINT, MAGT, MART, MAWT, MDT, MET, MEST, MHT, MIST, MIT, MMT, MSK, MST, MST, MUT, MVT, MYT, NCT, NDT, NFT, NPT, NST, NT, NUT, NZDT, NZST, OMST, ORAT, PDT, PET, PETT, PGT, PHOT, PHT, PKT, PMDT, PMST, PONT, PST, PST, PYST, PYT, RET, ROTT, SAKT, SAMT, SAST, SBT, SCT, SDT, SGT, SLST, SRET, SRT, SST, SST, SYOT, TAHT, THA, TFT, TJT, TKT, TLT, TMT, TRT, TOT, TVT, ULAST, ULAT, UTC, UYST, UYT, UZT, VET, VLAT, VOLT, VOST, VUT, WAKT, WAST, WAT, WEST, WET, WIT, WST, YAKT, YEKT

false

(UTC (default))

New date

Constructs a date from a year, month, and day –> learn more

DATE(@year, @month, @day)

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@year

true

-

@month

true

-

@day

true

-

Date add

Add a period of time to a date –> learn more

DATE_ADD(@date_expression, INTERVAL @integer_expression @date_part)

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@integer_expression

true

-

@date_part

any of: year, month, quarter, week, day

true

((e.g., days))

@date_expression

any date

true

-

Date diff

Calculate the distance between two dates –> learn more

DATE_DIFF(@date_expression, @date_expression_2, @date_part)

Return type

integer

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@date_expression_2

any date

true

-

@date_expression

any date

true

-

@date_part

any of: day, week, month, quarter, year

true

((e.g., days))

Date subtract

Subtract a period of time from a date –> learn more

DATE_SUB(@date_expression, INTERVAL @integer_expression @date_part)

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@integer_expression

true

-

@date_part

any of: day, week, month, quarter, year

true

((e.g., days))

@date_expression

any date

true

-

Date truncate

Truncates a date to the nearest boundary –> learn more

DATE_TRUNC(@date_expression, @date_truncate_part)

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@date_expression

any date

true

-

@date_truncate_part

any of: day, month, quarter, year, week(sunday), week(monday), week(tuesday), week(wednesday), week(thursday), week(friday), week(saturday), ISOquarter, ISOyear

true

((e.g., month))

Date extract

Extracts the date part (e.g, month) from a date –> learn more

EXTRACT(@date_part FROM @date_expression)

Return type

integer

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@date_part

any of: DAYOFWEEK, DAY, DAYOFYEAR, WEEK, MONTH, QUARTER, YEAR, ISOWEEK, ISOYEAR

true

((e.g., month))

@date_expression

true

-

Format date

Returns a formatted string from a date –> learn more

FORMAT_DATE(@format_string, @date_expression)

Return type

string

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@date_expression

any date

true

-

@format_string

any string

true

(e.g., %Y-%m-%d)

More details about format strings here

Parse date

Parses a date from a string –> learn more

[@safe]PARSE_DATE(@format_string, @date_string)

Return type

date

Parameters

Name
Type
Allowed values
Required
Placeholder (in UI)

@date_string

any string

true

-

@format_string

any string

true

(e.g., %Y-%m-%d)

@safe

true

-

More details about format strings here

Last updated