In MariaDB, GET_FORMAT()
is a built-in date and time function that returns a format string.
This function can be useful for when working with functions that require a format string, such as DATE_FORMAT()
and STR_TO_DATE()
.
In MariaDB, GET_FORMAT()
is a built-in date and time function that returns a format string.
This function can be useful for when working with functions that require a format string, such as DATE_FORMAT()
and STR_TO_DATE()
.
In MariaDB, FROM_UNIXTIME()
is a built-in date and time function that returns a datetime value based on a given unix timestamp.
You pass the unix timestamp to the function when you call it.
The result is returned in 'YYYY-MM-DD HH:MM:SS'
or YYYYMMDDHHMMSS.uuuuuu
format, depending on whether the function is used in a string or numeric context.
The value is expressed in the current time zone.
Continue readingIn MariaDB, TO_DAYS()
is a built-in date and time function that returns the number of days from the start of the standard calendar (0000-00-00), based on a given date.
You pass the date to the function when you call it.
The TO_DAYS()
function is the converse of the FROM_DAYS()
function.
In MariaDB, FROM_DAYS()
is a built-in date and time function that returns a date value based on a given number of days from the start of the standard calendar (0000-00-00).
You pass the number of days to the function when you call it.
The FROM_DAYS()
function is the converse of the TO_DAYS()
function.
In MariaDB, LAST_DAY()
is a built-in date and time function that returns the last day of the month for a given date.
It accepts one argument, which is the date for which you want to find the last day of the month.
Continue readingIn MariaDB, QUARTER()
is a built-in date and time function that returns the quarter from a given date expression.
It accepts one argument, which is the date you want to extract the quarter from.
It returns the quarter as a number in the range 1
to 4
. For dates with zero months (e.g. 0000-00-00
or 2025-00-00
), the result is 0
.
In MariaDB, YEAR()
is a built-in date and time function that returns the year from a given date expression.
It accepts one argument, which is the date you want to extract the year from.
It returns the year as a number in the range 1000
to 9999
. For zero dates (e.g. 0000-00-00
), the result is 0
.
In MariaDB, WEEKOFYEAR()
is a built-in date and time function that returns the calendar week of a given date as a number in the range from 1
to 53
.
It’s the equivalent of using the WEEK()
function in mode 3, and therefore its result is in accordance with ISO 8601:1988.
It accepts one argument; the date you want to extract the week from.
Continue readingIn MariaDB, YEARWEEK()
is a built-in date and time function that returns the year and week for a given date.
It accepts two arguments; the date you want to extract the year and week from, and an optional mode argument to specify the mode to use in the result.
It returns the week as a number in the range 0
to 53
or 1
to 53
, depending on the mode being used. Also, the year in the result may be different from the year in the date argument for the first and the last week of the year.
In MariaDB, WEEK()
is a built-in date and time function that returns the week from a given date expression.
It accepts two arguments; the date you want to extract the week from, and an optional mode argument to specify the mode to use in the result.
It returns the week as a number in the range 0
to 53
or 1
to 53
, depending on the mode being used.