Date

Current date

Returns the current date –> learn more

CURRENT_DATE([@time_zone])

Return type

date

Parameters

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