Question: I posted a question as to why the following query filed to search the date.

```
SELECT * FROM  Stuff Where Sell_by <= 2013-07-04;

```

I was given the newbie answer of "You are searching for the result of the equation 2013-07-04" 

That makes perfect sense to me. So I use the following and it come out just fine:

```
SELECT * FROM  Stuff Where Sell_by <= '2013-07-04';

```

But it raises another question: If 2013 minus 7 minus 4 is 2002. (I assume that is what MySQL is saying) 

When is day Zero? (And what is there any significance to that date?)

Answer: 
<http://dev.mysql.com/doc/refman/5.6/en/datetime.html> says:

> 
> MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The supported range is '1000-01-01' to '9999-12-31'.
> 
> 
> 

Later:

> 
> Invalid DATE, DATETIME, or TIMESTAMP values are converted to the “zero” value of the appropriate type ('0000-00-00' or '0000-00-00 00:00:00').
> 
> 
> 

Read the page for more details.
The answer depends on what `Sell_by` is. Your basic types to store dates are `DATE`, `DATETIME`, and `TIMESTAMP`. [From the MySQL manual](http://dev.mysql.com/doc/refman/5.5/en/datetime.html):

> 
> The DATE type is used for values with a date part but no time part.
>  MySQL retrieves and displays DATE values in 'YYYY-MM-DD' format. The
>  supported range is '1000-01-01' to '9999-12-31'.
> 
> 
> The DATETIME type is used for values that contain both date and time
>  parts. MySQL retrieves and displays DATETIME values in 'YYYY-MM-DD
>  HH:MM:SS' format. The supported range is '1000-01-01 00:00:00' to
>  '9999-12-31 23:59:59'.
> 
> 
> The TIMESTAMP data type is used for values that contain both date and
>  time parts. TIMESTAMP has a range of '1970-01-01 00:00:01' UTC to
>  '2038-01-19 03:14:07' UTC.
> 
> 
> 

It doesn't really make much sense to call January 1st, 1000 "day zero", though, at least in my opinion. It happens to be the earliest day representable by `DATE` and `DATETIME`, but it has a well-known value that's different from zero, namely the first day of the year 1000.

Okay, by that logic you could argue that 1970-01-01 doesn't have the right to call itself zero, either. But this starting date for `TIMESTAMP` is chosen as the [beginning point of Unix time](http://en.wikipedia.org/wiki/Unix_time). And since that time format is defined as "let's count the seconds that happend since the beginning of 1970" (...ish), it really *does* start with a zero.

Long story short, there is no "day zero", only things that could be interpreted as zero, depending how you look at them.