In SQL Server, you can use the MONTH()
function to convert a month name to its corresponding number.
How UTC_TIMESTAMP() Works in MariaDB
In MariaDB, UTC_TIMESTAMP()
is a built-in date and time function that returns the current UTC date and time.
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.
UTC stands for Coordinated Universal Time, and is the world standard for regulating time.
Continue readingHow UTC_TIME() Works in MariaDB
In MariaDB, UTC_TIME()
is a built-in date and time function that returns the current UTC time.
The result is returned in ‘HH:MM:SS’ or HHMMSS.uuuuuu format, depending on whether the function is used in a string or numeric context.
UTC stands for Coordinated Universal Time, and is the world standard for regulating time.
Continue readingHow UTC_DATE() Works in MariaDB
In MariaDB, UTC_DATE()
is a built-in date and time function that returns the current UTC date.
The result is returned in ‘YYYY-MM-DD’ or YYYYMMDD format, depending on whether the function is used in a string or numeric context.
UTC stands for Coordinated Universal Time, and is the world standard for regulating time.
Continue readingHow UNIX_TIMESTAMP() Works in MariaDB
In MariaDB, UNIX_TIMESTAMP()
is a built-in date and time function that returns a Unix timestamp, based on its argument (or lack of argument).
It works like this:
- When called without an argument, it returns a Unix timestamp (seconds since ‘1970-01-01 00:00:00’ UTC) as an unsigned integer.
- When called with an argument, it returns the value of the argument as seconds since ‘1970-01-01 00:00:00’ UTC.
The inverse function of UNIX_TIMESTAMP()
is FROM_UNIXTIME()
.
How TO_SECONDS() Works in MariaDB
In MariaDB, TO_SECONDS()
is a built-in date and time function that returns the number of seconds from year 0 to the given date or datetime expression.
How TIME_TO_SEC() Works in MariaDB
In MariaDB, TIME_TO_SEC()
is a built-in date and time function that returns its time argument, converted to seconds.
Insert Characters into the Middle of a String in SQL Server (T-SQL)
SQL Server provides the STUFF()
function that enables you to insert a string inside another string.
The function also allows you to specify the number of characters (if any) to delete from the original string in order to fit the new string.
Continue readingHow TIME_FORMAT() Works in MariaDB
In MariaDB, TIME_FORMAT()
is a built-in date and time function that formats a time value according to the given format string.
It works similar to the DATE_FORMAT()
function, except that the format string may only contain format specifiers for hours, minutes, and seconds.
It requires two arguments; the time and the format string.
Continue reading3 Ways to Extract the Year from a Date in SQL Server (T-SQL)
There are several ways to return the year from a date in SQL Server. Here are three (or is it four?).
Continue reading