8 Functions to Return the Day from a Date in MariaDB

MariaDB has quite a number of functions that return the day from a date. It all depends on how you want to do it, and what you mean by “day”.

MariaDB needs to know whether you want the day name, the day of the week number, the day of the month, day of year, etc.

Below are 8 functions that enable you to return the day from a date in MariaDB, in its various forms.

Continue reading

How to Add AM/PM to a Time or Datetime Value in MariaDB

MariaDB includes many functions that allow you to return time and datetime values in a variety of formats.

Two functions allow you to format the time portion using a 12 hour clock, with the AM/PM designator are DATE_FORMAT() and TIME_FORMAT().

There are many format specifiers that can be used with these functions, but only a couple that return the AM/PM designator.

Continue reading