title: Only Some Dates From SQL SELECT Being Set To "0" or "1969-12-31" -- UNIX_TIMESTAMP
body: <p>So I have been doing pretty well on my project (<a href="https://stackoverflow.com/questions/17596324/warnings-on-load-data-infile-from-csv-integers-and-dates">Link to previous StackOverflow question</a>), and have managed to learn quite a bit, but there is this one problem that has been <em> really</em> dogging me for days and I just can't seem to solve it. </p>
  
  <p>It has to do with using the UNIX_TIMESTAMP call to convert dates in my SQL database to UNIX time-format, but for some reason only one set of dates in my table is giving me issues!</p>
  
  <p>==============</p>
  
  <p>So these are the values I am getting - </p>
  
  <pre><code>#abridged here, see the results from the SELECT statement below to see the rest
  #of the fields outputted
  
  | firstVst   | nextVst    | DOB       |
  | 1206936000 | 1396238400 |         0 |
  | 1313726400 | 1313726400 | 278395200 |
  | 1318910400 | 1413604800 |         0 |
  | 1319083200 | 1413777600 |         0 |
  </code></pre>
  
  <p>when I use this SELECT statment -</p>
  
  <pre><code>SELECT SQL_CALC_FOUND_ROWS *,UNIX_TIMESTAMP(firstVst) AS firstVst,
  UNIX_TIMESTAMP(nextVst) AS nextVst, UNIX_TIMESTAMP(DOB) AS DOB FROM people 
  ORDER BY "ref DESC";
  </code></pre>
  
  <p><b>So my big question is:</b> why in the heck are 3 out of 4 of my DOBs being set to date of 0 (IE 12/31/1969 on my PC)? Why is this not happening in my other fields?</p>
  
  <hr>
  
  <p>I can see the data quite well using a more simple SELECT statement and the DOB field looks fine...?</p>
  
  <pre><code>#formatting broken to change some variable names etc.
  
  select * FROM people;
  
  | ref | lastName | firstName | DOB      | rN   | lN   | firstVst  | disp | repName        | nextVst   |
  | 10001 | BlankA   | NameA     | 1968-04-15 | 1000000 | 4600000 | 2008-03-31 | Positive  | Patrick Smith | 2014-03-31 |
  | 10002 | BlankB   | NameB     | 1978-10-28 | 1000001 | 4600001 | 2011-08-19 | Positive  | Patrick Smith | 2011-08-19 |
  | 10003 | BlankC   | NameC     | 1941-06-08 | 1000002 | 4600002 | 2011-10-18 | Positive  | Patrick Smith | 2014-10-18 |
  | 10004 | BlankD   | NameD     | 1952-08-01 | 1000003 | 4600003 | 2011-10-20 | Positive  | Patrick Smith | 2014-10-20 |
  </code></pre>