title: MySQL YEAR Comparison
body: <p>Years ago, I wrote a query and now while going back through some of this old code I'm trying to figure out why I did it the way it had been done. The intent, as far as I can tell, was to simply extract the year from a UNIX timestamp. Can anyone tell me what the benefit might have been to use:</p>
  
  <pre><code>YEAR(DATE_ADD(DATE_SUB(DATE_ADD(FROM_UNIXTIME( 0 ), INTERVAL FullDate SECOND), INTERVAL @@session.time_zone HOUR_MINUTE), INTERVAL '08:00' HOUR_MINUTE))
  </code></pre>
  
  <p>Instead of simply:</p>
  
  <pre><code>DATE_FORMAT(FROM_UNIXTIME(FullDate), '%Y')
  </code></pre>