6 Ways to Add a Month to a Date in MariaDB

MariaDB provides several ways to perform arithmetic on dates. This includes adding or subtracting a month (or many months) from a given date.

Here are 6 ways to add a month to a date in MariaDB.

Bonus update: I’ve now added a 7th way to add a month to a date at the end of this article. So I guess it’s now 7 ways to add a month to a date in MariaDB 🙂

Read more

How DAYOFMONTH() Works in MariaDB

In MariaDB, DAYOFMONTH() is a built-in date and time function that returns the day of the month from a given date.

It accepts one argument, which is the date you want to extract the day of the month from.

The result is in the range 1 to 31. However, if the date has a zero day part (for example '0000-00-00' or '2021-00-00'), the result is 0.

Read more

How to Show all Locales in MariaDB

MariaDB supports a large list of locales that are used by functions such as DAYNAME(), MONTHNAME() and DATE_FORMAT().

While these locales are available to MariaDB, by default they’re not loaded into any of the system tables, so you can’t run a query to retrieve them.

However, MariaDB provides a plugin that does load these into a table. Once the plugin has been installed, you can query that table to return the locales available in MariaDB.

Read more