title: How to convert unix timestamp column to date format in PostgreSQL?
body: <p>I'm trying to obtain the results in yyyy-mm-dd format from unixtimestamp column but getting in yyyy-mm-dd hh:mm:ss</p>
  
  <p>My data in receive_time column is following:</p>
  
  <pre><code>recieve_time
  
  1557866863  |
  1557866863  |
  1557866863  |
  1557866863  |
  1557866864  |
  1557866864  |
  1557866864  |
  1557866864  |
  </code></pre>
  
  <p>Following is my query:</p>
  
  <pre><code>SELECT
  to_timestamp(recieve_time) as date, count(*)
   FROM public.cdrs WHERE 
  usage_type='0800 Voice Incoming' 
  and to_timestamp(recieve_time) &gt;='2019-05-01 00:00:00'
  AND to_timestamp(recieve_time) &lt;'2019-06-01 00:00:00'
  AND main_bzd &gt;0 
  group by to_timestamp(recieve_time)
  </code></pre>
  
  <p>Getting this:</p>
  
  <pre><code>date                 |count|
  
  -------------------|-----|
  
  2019-05-01 00:00:2 |1    |
  2019-05-01 00:03:2 |1    |
  2019-05-01 01:20:0 |1    |
  2019-05-01 01:21:1 |1    |
  2019-05-01 01:53:0 |1    |
  2019-05-01 02:16:5 |1    |
  2019-05-01 02:33:5 |1    |
  2019-05-01 02:39:4 |1    |
  2019-05-01 02:55:3 |1    |
  2019-05-01 03:32:5 |1    |
  2019-05-01 03:35:0 |1    |
  </code></pre>
  
  <p>My requirement is following:</p>
  
  <pre><code>date        |count|
  
  ------------|-----|
  
  2019-05-01  |19   |
  2019-05-02  |15   |
  2019-05-03  |17   |
  </code></pre>