title: Using zero value in MySQL columns of type TIMESTAMP
body: <p>I'm a little confused over the documentation of type TIMESTAMP in MySQL and whether the zero value is safe to use. The <a href="http://dev.mysql.com/doc/refman/5.0/en/datetime.html" rel="noreferrer">manual says</a>:</p>
  
  <blockquote>
    <p>The TIMESTAMP data type has a range of '1970-01-01 00:00:01' UTC to '2038-01-19 03:14:07' UTC. ...</p>
  </blockquote>
  
  <p>which implies that '0000-00-00 00:00:00' is out of range and thus not valid. But, as far as I can see, the manual does notactually say this. Nor does it explicitly say that '0000-00-00 00:00:00' <strong>is</strong> a valid value.</p>
  
  <p>Practice shows that '0000-00-00 00:00:00' works and the <a href="http://dev.mysql.com/doc/refman/5.0/en/timestamp.html" rel="noreferrer">manual <em>does</em> say</a> that: </p>
  
  <pre><code>CREATE TABLE t (ts TIMESTAMP DEFAULT 0);
  </code></pre>
  
  <p>is valid MySQL SQL. In practice it leads to insertion of '0000-00-00 00:00:00' defaults.</p>
  
  <p>(All of this sort of aligns with the curious fact that '1970-01-01 00:00:00' is out of range, which, IIRC, is not the case for a uint32 unix time. Perhaps MySQL uses binary zero as a magic number?)</p>
  
  <p>So is it safe to assign semantics to zero TIMESTAMPs in the application? Or is this an undocumented feature that might go away?</p>