title: PL SQL - Convert timestamp to datetime/date
body: <pre><code>select 
  to_timestamp(SCHEDULED_TIME,'YYYY-MM-DD HH24:MI:SS.FF') as SCHEDULED_TIME,
  TRUNC(to_date(to_timestamp(SCHEDULED_TIME,'YYYY-MM-DD HH24:MI:SS.FF'),'YYYY-MM-DD HH24:MI:SS'))
  from S_TIDAL_STATUS
  </code></pre>
  
  <p>The error was:
  ORA-01830: date format picture ends before converting entire input string
  01830. 00000 -  "date format picture ends before converting entire input string"</p>
  
  <p>The goal is to return something like </p>
  
  <p>2017-07-91 23:14:00 
  (without the content after the dot).</p>
  
  <p>Here's what the SCHEDULED_TIME (timestamp) looked like:
  <a href="https://i.stack.imgur.com/fTbWn.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/fTbWn.png" alt="enter image description here"></a></p>