In MariaDB, you can use the DATE_FORMAT() function to return various date parts from a date. One of the things you can return is the short day name. For example Tue or Wed (instead of Tuesday or Wednesday).
dates
3 Ways to Convert a String to a Date in MongoDB
If you have a MongoDB collection with dates stored as strings, you can convert those into the Date BSON type if required.
Below are three ways to convert a string into a Date in MongoDB.
Change the Time Zone Offset on a datetimeoffset Value in SQL Server (T-SQL)
You can use the SWITCHOFFSET() function in SQL Server to change the time zone offset on a datetimeoffset value.
The function accepts two arguments; a datetimeoffset(n) value (or an expression that can be resolved to a datetimeoffset(n) value), and the new time zone.
MongoDB Aggregation Operators for Returning Date Parts
This article lists the various aggregation pipeline operators that can be used to return individual date parts from a Date object in MongoDB.
4 Functions to Get the Hour from a Time Value in MariaDB
Below are 4 functions that enable you to return the hour from a time value in MariaDB.
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.
2 Ways to Get the Short Month Name from a Date in MariaDB
Here are two ways to return the short month name from a date in MariaDB.
4 Functions that Return the Minutes from a Time Value in MariaDB
Below are 4 functions that enable you to return the minutes portion from a time value in MariaDB.
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.
How to Subtract a Year from a Date in MariaDB
MariaDB provides several ways to perform arithmetic on dates. This includes adding or subtracting a year (or many years) from a given date.
Here’s an example of subtracting a year from a date in MariaDB.