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.
Category: DBMS
Database Management Systems
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 readingHow TIMESTAMPDIFF() Works in MariaDB
In MariaDB, TIMESTAMPDIFF()
is a built-in date and time function that returns the difference between two date or datetime expressions.
How TIMESTAMPADD() Works in MariaDB
In MariaDB, TIMESTAMPADD()
is a built-in date and time function that adds an integer expression interval to a given date or datetime expression.
How TIMESTAMP() Works in MariaDB
In MariaDB, TIMESTAMP()
is a built-in date and time function that returns a datetime value, based on its argument/s.
It can be used with either one argument or two, as follows:
- When used with one argument, it returns that date or datetime expression as a datetime value.
- When used with two arguments, it adds the second (time) argument to the first (date or datetime) expression, then returns the resulting datetime value.
How TIMEDIFF() Works in MariaDB
In MariaDB, TIMEDIFF()
is a built-in date and time function that returns the difference between two time values or datetime values, expressed as a time value.
It’s similar to the DATEDIFF()
function, except that DATEDIFF()
‘s return value is expressed in days.
TIMEDIFF()
accepts two arguments, both of which are time or datetime expressions. It then subtracts the second time from the first.
How TIME() Works in MariaDB
In MariaDB, TIME()
is a built-in date and time function that extracts the time part from a given time or datetime expression and returns it as a string.
It accepts one argument, which is the time or datetime value for which you want to extract the time.
Continue reading