Date and Time Functions TO_DAYS()  is not intended for use with values that precede the advent of the Gregorian calendar (1582), because it does not take into account the days that were lost when the calendar was changed. For dates before 1582 (and possibly a later year in other locales), results from this function are not reliable. See Section 12.9, “What Calendar Is Used By MySQL?” , for details. Remember that MySQL converts two-digit year values in dates to four-digit form using the rules in Section 11.2, “Date and Time Data Types” . For example,  ’2008-10-07’  and  ’08-10-07’  are seen as identical dates: In MySQL, the zero date is defined as  ’0000-00-00’ , even though this date is itself considered invalid. This means that, for  ’0000-00-00’  and  ’0000-01-01’ ,  TO_DAYS()  returns the values shown here: This is true whether or not the  ALLOW_INVALID_DATES  SQL server mode is enabled. • TO_SECONDS( expr ) Given a date or datetime  expr , returns the number of seconds since the year 0. If  expr  is not a valid date or datetime value, returns  NULL . mysql>  SELECT TO_SECONDS(950501); -> 62966505600 mysql>  SELECT TO_SECONDS(’2009-11-29’); -> 63426672000 mysql>  SELECT TO_SECONDS(’2009-11-29 13:43:32’); -> 63426721412 mysql>  SELECT TO_SECONDS( NOW() ); -> 63426721458 Like  TO_DAYS() ,  TO_SECONDS()  is not intended for use with values that precede the advent of the Gregorian calendar (1582), because it does not take into account the days that were lost when the 2166 mysql>  SELECT TO_DAYS(’2007-10-07’); -> 733321 mysql>  SELECT TO_DAYS(’2008-10-07’), TO_DAYS(’08-10-07’); -> 733687, 733687 mysql>  SELECT TO_DAYS(’0000-00-00’); +-----------------------+ | to_days(’0000-00-00’) | +-----------------------+ | NULL | +-----------------------+ 1 row in set, 1 warning (0.00 sec) mysql>  SHOW WARNINGS; +---------+------+----------------------------------------+ | Level | Code | Message | +---------+------+----------------------------------------+ | Warning | 1292 | Incorrect datetime value: ’0000-00-00’ | +---------+------+----------------------------------------+ 1 row in set (0.00 sec) mysql>  SELECT TO_DAYS(’0000-01-01’); +-----------------------+ | to_days(’0000-01-01’) | +-----------------------+ | 1 | +-----------------------+ 1 row in set (0.00 sec)