title: Postgres date from NodeJS
body: <p>I'm having difficulties with getting date format right from PostgreSQL db to NodeJS with the following string:</p>
  
  <p><strong>const queryStr = 'SELECT TO_CHAR(created_on, 'DD-Mon-YYYY') from database';</strong></p>
  
  <p>What I get is the following error since I guess node is not interpreting the parameters rigth:</p>
  
  <pre><code>C:\[...]\Project\server.js:24
                              'TO_CHAR(created_on, 'DD-Mon-YYYY')'
                                                    ^^
  
  SyntaxError: Unexpected identifier
  
  at new Script (vm.js:51:7)
  at createScript (vm.js:136:10)
  at Object.runInThisContext (vm.js:197:10)
  at Module._compile (internal/modules/cjs/loader.js:618:28)
  at Object.Module._extensions..js (internal/modules/cjs/loader.js:665:10)
  at Module.load (internal/modules/cjs/loader.js:566:32)
  at tryModuleLoad (internal/modules/cjs/loader.js:506:12)
  at Function.Module._load (internal/modules/cjs/loader.js:498:3)
  at Function.Module.runMain (internal/modules/cjs/loader.js:695:10)
  at startup (internal/bootstrap/node.js:201:19)
  </code></pre>
  
  <p>Also "DD-Mon-YYYY" is not working.
  I don't know how to "escape" the TO_CHAR format in order to format the date in the way I want.
  Any idea is highly appreciated.
  Thanks.</p>