In MariaDB, MAKEDATE() is a built-in date and time function that returns a date, based on the year and day of year provided as arguments.
Ian
How GET_FORMAT() Works in MariaDB
In MariaDB, GET_FORMAT() is a built-in date and time function that returns a format string.
This function can be useful for when working with functions that require a format string, such as DATE_FORMAT() and STR_TO_DATE().
How FROM_UNIXTIME() Works in MariaDB
In MariaDB, FROM_UNIXTIME() is a built-in date and time function that returns a datetime value based on a given unix timestamp.
You pass the unix timestamp to the function when you call it.
The result is returned in 'YYYY-MM-DD HH:MM:SS' or YYYYMMDDHHMMSS.uuuuuu format, depending on whether the function is used in a string or numeric context.
The value is expressed in the current time zone.
How TO_DAYS() Works in MariaDB
In MariaDB, TO_DAYS() is a built-in date and time function that returns the number of days from the start of the standard calendar (0000-00-00), based on a given date.
You pass the date to the function when you call it.
The TO_DAYS() function is the converse of the FROM_DAYS() function.
How FROM_DAYS() Works in MariaDB
In MariaDB, FROM_DAYS() is a built-in date and time function that returns a date value based on a given number of days from the start of the standard calendar (0000-00-00).
You pass the number of days to the function when you call it.
The FROM_DAYS() function is the converse of the TO_DAYS() function.
3 Ways to Get the Month Name from a Date in MariaDB
Here are three ways to return the month name from a date in MariaDB.
How LAST_DAY() Works in MariaDB
In MariaDB, LAST_DAY() is a built-in date and time function that returns the last day of the month for a given date.
It accepts one argument, which is the date for which you want to find the last day of the month.
Subtract a Month 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.
How QUARTER() Works in MariaDB
In MariaDB, QUARTER() is a built-in date and time function that returns the quarter from a given date expression.
It accepts one argument, which is the date you want to extract the quarter from.
It returns the quarter as a number in the range 1 to 4. For dates with zero months (e.g. 0000-00-00 or 2025-00-00), the result is 0.
2 Ways to Get the Default Language of a Login in SQL Server (T-SQL)
There are (at least) a couple of ways you can use T-SQL to return the default language of a specified login in SQL Server.
In particular, you can use the following methods:
- Query the
LOGINPROPERTY()function. - Query the
sys.server_principalssystem catalog view in themasterdatabase.
Examples of these are below.