title: Convert UTC timestamp to yyyyMMddHHmmss.SSS format in hive
body: <p>I have a scenario like below in hive</p>
  
  <p>convert the current_timestamp to UTC. I am able to do so</p>
  
  <pre><code>select to_utc_timestamp(current_timestamp, 'America/Los_Angeles)';
  </code></pre>
  
  <p>Result:</p>
  
  <pre><code>2020-02-04 10:00:06.162
  </code></pre>
  
  <p>Next convert this resulting timestamp to <code>yyyyMMddHHmmssSSS</code> format.</p>
  
  <p>I have tried like below</p>
  
  <pre><code>select from_unixtime((to_utc_timestamp(current_timestamp, 'America/Los_Angeles)', 'yyyy-MM-dd HH:mm:ss.SSS'), 'yyyyMMddHHmmssSSS');
  </code></pre>
  
  <p>I am unable to get the desired result.</p>
  
  <p>expected result is <code>20200204100006162</code></p>