Last time we looked at a few of the more commonly used date and
time functions. This time we're going to look at some of the
less well-known functions. First, we will need to understand the
various date and time types MySQL accepts for passing to many of
these functions. As you can see, there are quite a few. Notice
that the ones spanning a number of time elements (such as
DAY_SECOND) include all the elements between DAY and SECOND (in
this case HOUR and MINUTE). In the last article, we looked at a
specific date calculation to determine age. However, there's a
lot more you can do in MySQL before you need to call upon a
programming language for assistance. Adding and subtracting
dates and times with DATE_ADD() and DATE_SUB() The DATE_ADD()
function - ADDDATE() is a synonmym - is used to add a particular
date or time interval to a give date or time. DATE_ADD(datetime,
INTERVAL expression datetimetype) For example, to find a date 14
days after the 13th July, 2003, you can use: Note that when
using a datetime typ