MySQL date functions that help you directly get required part of date. Commonly used MySQL date functions. These MySQL date functions are easy to remember.
MySQL Date format is a very handy function. It formats a date as specified in the argument. Here’s a cheat sheet for MySQL date format function.
Here are a few commonly used commands to find current year, current month and current day in MySQL. You can use date format is different variations for it.
To calculate age from date you can use the following MySQL query. This is useful to find out recency of activity. Just replace with your column names.
Calculating difference between two dates in MySQL is really easy. Here’s how you can do it. Let’s say dt1 and dt2 are 2 columns in table table_name.