title: parquet int96 timestamp conversion to datetime/date via python
body: <h1>TL;DR</h1>
  
  <p>I'd like to <strong>convert an int96 value such as ACIE4NxJAAAKhSUA</strong> into a <em>readable</em> timestamp format like <strong>2020-03-02 14:34:22</strong> or whatever that could be normally interpreted...I mostly use python so I'm looking to build a function that does this conversion.  If there's another function that can do the reverse -- even better.</p>
  
  <h1>Background</h1>
  
  <p>I'm using parquet-tools to convert a raw parquet file (with snappy compression) to raw JSON via this commmand:</p>
  
  <pre><code>C:\Research&gt; java -jar parquet-tools-1.8.2.jar cat --json original-file.snappy.parquet &gt; parquet-output.json
  </code></pre>
  
  <p>Inside the JSON, I'm seeing these values as the timestamps:</p>
  
  <pre><code>{... "_id":"101836","timestamp":"ACIE4NxJAAAKhSUA"}
  </code></pre>
  
  <p>I've determined that the timestamp value of "ACIE4NxJAAAKhSUA" is really int96 (this is also confirmed with reading the schema of the parquet file too....</p>
  
  <pre><code>message spark_schema {
   ...(stuff)...
    optional binary _id (UTF8);
    optional int96 timestamp;
  }
  </code></pre>
  
  <p>I think this is also known as Impala Timestamp as well (at least that's what I've gathered)</p>
  
  <h1>Further Issue Research</h1>
  
  <p>I've been searching everywhere for some function or info regarding how to "read" the int96 value (into python -- I'd like to keep it in that language since I'm most familiar with it) and output the timestamp -- I've found nothing.</p>
  
  <p>Here's a very articles I've already looked into (that's related to this subject):</p>
  
  <ul>
  <li>ParquetWriter research in SO <a href="https://stackoverflow.com/questions/54657496/how-to-write-timestamp-logical-type-int96-to-parquet-using-parquetwriter">here</a></li>
  <li>Casting int96 via golan in SO <a href="https://stackoverflow.com/questions/53103762/cast-int96-timestamp-from-parquet-to-golang">here</a> NOTE: this has a function that I could explore but I'm not sure how to dive in too deep</li>
  </ul>
  
  <h1>Regarding the depreciated int96 timestamp</h1>
  
  <p>Please don't ask me to stop using an old/depreciated timestamp format within a parquet file, I'm well aware of that with the research I've done so far.  I'm a receiver of the file/data -- I can't change the format used on creation.</p>
  
  <p>If there's another way to control the initial JSON output to deliver a "non int96" value -- I'd be interested in that as well.</p>
  
  <p>Thanks so much for your help SO community!</p>