Date
Current date
Returns the current date –> learn more
CURRENT_DATE([@time_zone])Return type
date
Parameters
@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
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
Date diff
Calculate the distance between two dates –> learn more
DATE_DIFF(@date_expression, @date_expression_2, @date_part)Return type
integer
Parameters
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
Date truncate
Truncates a date to the nearest boundary –> learn more
DATE_TRUNC(@date_expression, @date_truncate_part)Return type
date
Parameters
Date extract
Extracts the date part (e.g, month) from a date –> learn more
EXTRACT(@date_part FROM @date_expression)Return type
integer
Parameters
Format date
Returns a formatted string from a date –> learn more
FORMAT_DATE(@format_string, @date_expression)Return type
string
Parameters
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
More details about format strings here
Last updated
Was this helpful?