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.
Tag: functions
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.
How 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 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 readingHow SYSDATE() Works in MariaDB
In MariaDB, SYSDATE()
is a built-in date and time function that returns the current date and time.
It returns the time that the function was executed (which could be different to the time that the statement was executed).
The return value 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 return value is expressed in the current time zone.
You also have the option of specifying the microsecond precision.
Continue readingHow STR_TO_DATE() Works in MariaDB
In MariaDB, STR_TO_DATE()
is a built-in date and time function that returns a datetime value, based on the given date string and format string.
The STR_TO_DATE()
function is the inverse of the DATE_FORMAT()
function.