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.
8 Ways to Add Seconds to a Datetime Value in MariaDB
If you need to add one or more seconds to a datetime value in MariaDB, here are 8 options to consider.
Continue readingHow SEC_TO_TIME() Works in MariaDB
In MariaDB, SEC_TO_TIME()
is a built-in date and time function that returns a time value, based on the number of seconds provided as arguments.
How PERIOD_DIFF() Works in MariaDB
In MariaDB, PERIOD_DIFF()
is a built-in date and time function that returns the number of months between two periods.