title: extracting year from unix time in PostgreSQL
body: <p>I have a Log table and this is it's description: </p>
  
  <pre><code>user_id(bigint)
    time (bigint)
  </code></pre>
  
  <p>My question is, how can I extract the year from the <code>time</code> column in PostgreSQL?</p>
  
  <p>This works in <strong>MySQL</strong>:</p>
  
  <pre><code> SELECT l.user_id, year(from_unixtime(l.time)) 
   FROM log l;
  </code></pre>