Here are some options for subtracting one or more minutes from a datetime expression in MariaDB.
Continue readingCategory: MariaDB
How CONVERT_TZ() Works in MariaDB
In MariaDB, CONVERT_TZ()
is a built-in date and time function that converts a datetime value from one time zone to another.
When you call the function, you pass three arguments: the time, the time zone to convert from, and the time zone to convert to.
Continue readingFix: Access denied for user ‘root’@’localhost’ in MariaDB
If you’re getting an error telling you that access is denied for the root
user in MariaDB, this article may help.
How to Set Up Named Time Zones in MariaDB
If you want to use named time zones in MariaDB, you’ll need to make sure they’ve been configured.
By “named time zones”, I mean being able to use strings like America/Los_Angeles
instead of −08:00
or −07:00
when specifying the time zone. For example, when using the CONVERT_TZ()
function.
Here’s how to configure named time zones in MariaDB.
Continue reading8 Ways to Add Days to a Date in MariaDB
MariaDB provides several ways to add a certain number of days to a given date. For example, you might want to add 10 days to a date, or 30 days, or even just 1 day. Fortunately, MariaDB makes this easy.
Here are 8 ways to add a number of days to a given date in MariaDB.
Continue readingHow ADDTIME() Works in MariaDB
In MariaDB, ADDTIME()
is a built-in date and time function that adds an amount to a time or datetime expression.
It allows you to change a time or datetime expression by passing that expression, as well as a time expression to add to that expression. You can pass a negative amount if you need to subtract from the time expression.
Continue readingHow SUBTIME() Works in MariaDB
In MariaDB, SUBTIME()
is a built-in date and time function that subtracts an amount from a time or datetime expression.
It allows you to change a time or datetime expression by passing that expression, as well as a time expression to subtract from that expression. You can pass a negative amount if you need to add to the time expression.
Continue readingMariaDB Date and Time Units
Below is a full list of the date and time units that can be used in MariaDB.
Continue readingHow SUBDATE() Works in MariaDB
In MariaDB, SUBDATE()
is a built-in date and time function that subtracts an amount from a given date.
It allows you to change a date by specifying the date, the unit to subtract, and the amount to subtract. You can pass a negative amount in order to add to the date, instead of subtracting from it.
SUBDATE()
also has a shortcut syntax that allows you to specify the days to subtract.
How DATE_SUB() Works in MariaDB
In MariaDB, DATE_SUB()
is a built-in date and time function that allows you to subtract an amount from a date.
It allows you to change a date by specifying the date, the unit to subtract, and the amount to subtract. You can pass a negative amount in order to add to the date, instead of subtracting from it.
Continue reading