MariaDB includes many functions for working with dates. Some of these extract certain parts from such dates and return them as a string or integer.
Below are 11 functions that you can use to return various date parts in MariaDB.
MariaDB includes many functions for working with dates. Some of these extract certain parts from such dates and return them as a string or integer.
Below are 11 functions that you can use to return various date parts in MariaDB.
If you need to add one or more microseconds to a datetime value in MariaDB, here are 8 options to consider.
MongoDB has a Date BSON type that allows you to store dates as dates.
You can also store dates as strings, if that’s what you need.
Taking it a step further, you can also convert a Date to a string.
This article presents three ways to convert a Date to a string in MongoDB.
In SQL Server, you can use the MONTH() function to convert a month name to its corresponding number.
There are several ways to return the year from a date in SQL Server. Here are three (or is it four?).
If you need to add one or more seconds to a datetime value in MariaDB, here are 8 options to consider.
Here are three ways to return the month name from 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’s an example of subtracting a month from a date in MariaDB.
In MariaDB, MONTHNAME() is a built-in date and time function that returns the name of the month name for a given date.
It accepts one argument, which is the date you want to extract the month name from.
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 🙂