title: How do I get the epoch time of a provided date natively on OS X?
body: <p>I've read <a href="https://developer.apple.com/library/Mac/documentation/Darwin/Reference/ManPages/man1/date.1.html" rel="nofollow">the manual</a>; tried different formats, and I still cannot get the epoch time from a date:</p>
  
  <pre><code>$ date -j -f "+%Y-%m-%d %H:%M:%S" "2014-11-20 16:38:06" "+%s"
  Failed conversion of ``2014-11-20 16:38:06'' using format ``+%Y-%m-%d %H:%M:%S''
  date: illegal time format
  usage: date [-jnu] [-d dst] [-r seconds] [-t west] [-v[+|-]val[ymwdHMS]] ... 
          [-f fmt date | [[[mm]dd]HH]MM[[cc]yy][.ss]] [+format]
  </code></pre>
  
  <p>The equivalent on Linux is <code>date -d "$DATE" "+%s"</code>. I need to compare two dates, and my next line of code is a simple <code>DIFF=((U - D))</code>. How do I get this from OS X's crazy <code>date</code> command?</p>