title: Understanding TO_CHAR to convert dates in oracle
body: <p>I have an oracle data problem which i would like to understand.</p>
  
  <p>So below are some queries which i executed and on comments are the outputs.</p>
  
  <pre><code>SELECT SYSDATE FROM DUAL; --19-DEC-17 
  SELECT TO_CHAR(SYSDATE,'DD/MM/YYYY') FROM DUAL; -- 19/12/2017
  SELECT TO_CHAR(SYSDATE,'MM/DD/YYYY') FROM DUAL; -- 12/19/2017
  </code></pre>
  
  <p>My question is what kind of date format does the to_char method expecting as the first parameter ? is there a default date format we need to pass?</p>
  
  <p>So i tried this below query as well which throws an error. 
  if some expert could explain me on how the to_char is working, it would be great.</p>
  
  <pre><code>SELECT TO_CHAR('19/12/2017','DD/MM/YYYY') FROM DUAL;
  
  ORA-01722: invalid number
  01722. 00000 -  "invalid number"
  *Cause:    The specified number was invalid.
  *Action:   Specify a valid number.
  </code></pre>