title: PostgreSQL - Truncating A Date Within Age Function
body: <p>I have the following query:</p>
  
  <pre><code>SELECT usersid as user,
  (age(creationtime)) as account_days
  FROM users
  </code></pre>
  
  <p>which outputs users (an integer) and account_days which uses the timestamp to output the age (i.e. 58 days, 2:31:31.387746).</p>
  
  <p>I want the output to just say 58, instead of 58 days, 2:31:31.387746. How would I go about this? I attempted </p>
  
  <pre><code>SELECT usersid as user,
  EXTRACT(day FROM(age(creationtime))) as account_days
  FROM users
  </code></pre>
  
  <p>but it changes the output to a number that doesn't tie out.</p>
  
  <p>Im using version PostgreSQL 9.2.4 on x86_64-unknown-linux-gnu, compiled by gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3, 64-bit</p>