Date and Time Functions mysql>  SHOW WARNINGS\G *************************** 1. row *************************** Level: Warning Code: 1411 Message: Incorrect datetime value: ’00/00/0000’ for function str_to_date Note You cannot use format  "%X%V"  to convert a year-week string to a date because the combination of a year and week does not uniquely identify a year and month if the week crosses a month boundary. To convert a year-week to a date, you should also specify the weekday: When invoked with the  INTERVAL  form of the second argument,  SUBDATE()  is a synonym for DATE_SUB() . For information on the  INTERVAL unit  argument, see the discussion for  DATE_ADD() . mysql>  SELECT STR_TO_DATE(’200442 Monday’, ’%X%V %W’); -> ’2004-10-18’ • SUBDATE( date ,INTERVAL  expr unit ) ,  SUBDATE( expr , days ) • SUBTIME( expr1 , expr2 ) • SYSDATE([ fsp ]) The second form enables the use of an integer value for  days . In such cases, it is interpreted as the number of days to be subtracted from the date or datetime expression  expr . SUBTIME()  returns  expr1 − expr2  expressed as a value in the same format as  expr1 .  expr1  is a time or datetime expression, and  expr2  is a time expression. Returns the current date and time as a value in  ’ YYYY-MM-DD hh:mm:ss ’  or  YYYYMMDDhhmmss format, depending on whether the function is used in string or numeric context. If the  fsp  argument is given to specify a fractional seconds precision from 0 to 6, the return value includes a fractional seconds part of that many digits. SYSDATE()  returns the time at which it executes. This differs from the behavior for  NOW() , which returns a constant time that indicates the time at which the statement began to execute. (Within a stored function or trigger,  NOW()  returns the time at which the function or triggering statement began to execute.) 2163 mysql>  SELECT NOW(), SLEEP(2), NOW(); mysql>  SELECT SYSDATE(), SLEEP(2), SYSDATE(); +---------------------+----------+---------------------+ | NOW() | SLEEP(2) | NOW() | +---------------------+----------+---------------------+ | 2006-04-12 13:47:36 | 0 | 2006-04-12 13:47:36 | +---------------------+----------+---------------------+ mysql>  SELECT SUBTIME(’2007-12-31 23:59:59.999999’,’1 1:1:1.000002’); -> ’2007-12-30 22:58:58.999997’ mysql>  SELECT SUBTIME(’01:00:00.999999’, ’02:00:00.999998’); -> ’-00:59:59.999999’ mysql>  SELECT SUBDATE(’2008-01-02 12:00:00’, 31); -> ’2007-12-02 12:00:00’ mysql>  SELECT DATE_SUB(’2008-01-02’, INTERVAL 31 DAY); -> ’2007-12-02’ mysql>  SELECT SUBDATE(’2008-01-02’, INTERVAL 31 DAY); -> ’2007-12-02’