title: Why do I need to divide the timestamp by 1 billion?
body: <p>I'm using this public Postgres DB of NEAR protocol: <a href="https://github.com/near/near-indexer-for-explorer#shared-public-access" rel="nofollow noreferrer">https://github.com/near/near-indexer-for-explorer#shared-public-access</a></p>
  <p>There is a field called <code>included_in_block_timestamp</code> whose &quot;data type&quot; = &quot;numeric&quot;, and &quot;length/precision&quot; = 20.</p>
  <p>This code works:</p>
  <pre class="lang-sql prettyprint-override"><code>to_char(TO_TIMESTAMP(&quot;public&quot;.&quot;receipts&quot;.&quot;included_in_block_timestamp&quot;/1000000000), 'YYYY-MM-DD HH:mm') as moment, 
  </code></pre>
  <p>and so does this:</p>
  <pre><code>function convertTimestampDecimalToDayjsMoment(timestampDecimal: Decimal) {
    const timestampNum = Number(timestampDecimal) / 1_000_000_000; // Why is this necessary?
    console.log({ timestampNum });
    const moment = dayjs.unix(timestampNum); // https://day.js.org/docs/en/parse/unix-timestamp
    return moment;
  }
  </code></pre>
  <p>For example, sometimes <code>included_in_block_timestamp</code> = 1644261932960444221.</p>
  <p>I've never seen a timestamp where I needed to divide by 1 billion. Figuring this out just now was a matter of trial and error.</p>
  <p>What's going on here? Is this common practice? Does this level of precision even make sense?</p>