Below is a full list of date and time locales available in MariaDB.
dates
MariaDB Date Format Strings
Below is a full list of format specifiers that can be used in format strings with functions like DATE_FORMAT(), STR_TO_DATE(), and FROM_UNIXTIME() in MariaDB.
6 Ways to Add a Year to a Date in MariaDB
MariaDB provides several ways to add a year or a certain number of years to a given date. For example, you might want to add 1 year, 10 years, 30 years, etc.
Here are 6 ways to add a year to a date in MariaDB.
How to Subtract Minutes from a Datetime Value in MariaDB
Here are some options for subtracting one or more minutes from a datetime expression in MariaDB.
How to Set Up Named Time Zones in MariaDB
If you want to use named time zones in MariaDB, you’ll need to make sure they’ve been configured.
By “named time zones”, I mean being able to use strings like America/Los_Angeles instead of −08:00 or −07:00 when specifying the time zone. For example, when using the CONVERT_TZ() function.
Here’s how to configure named time zones in MariaDB.
How to Format the Date in MongoDB
If you have documents that store dates as Date objects, but you want to return them in a different format, you can use the $dateToString aggregate pipeline operator.
For example, you might want a date to be returned in mm/dd/yyyy format instead of the long ISODate() format that includes minutes, seconds, milliseconds, etc
The $dateToString operator converts the Date object to a string, and optionally allows you to specify a format for the resulting output.
8 Ways to Add Days to a Date in MariaDB
MariaDB provides several ways to add a certain number of days to a given date. For example, you might want to add 10 days to a date, or 30 days, or even just 1 day. Fortunately, MariaDB makes this easy.
Here are 8 ways to add a number of days to a given date in MariaDB.
MariaDB Date and Time Units
Below is a full list of the date and time units that can be used in MariaDB.
Convert a Month Number to the Month Name in SQL Server (T-SQL)
You can use the T-SQL code below to convert a month number to its corresponding name in SQL Server.
This is for times where you don’t actually have the full date – when all you have is the month number. If you do have the date, then here’s how to get the month name from a date.
Get the Short Day Name in SQL Server (T-SQL)
In SQL Server, you can use the FORMAT() function to return the short day name from a date. FORMAT() is a T-SQL function that enables you to format dates and numbers to a specified format.
This function returns its result as a string. Specifically, it returns it as either a nvarchar or null as the case may be.