title: NodeJS dateFormat not working
body: <p>When I retrieve a a column from my MySQL database (using mysql node module), I get a useless date formatted like:</p>
  
  <p>Wed Sep 12 2012 08:44:26 GMT+0100 (GMT Daylight Time)</p>
  
  <p>When I try to use the dateformat module on the returned result I simply get "Invalid date".</p>
  
  <p>I want the date to be formatted the way MySQL formats it i.e. YYYY-MM-DD HH:MM:SS</p>
  
  <p>Here is my script:</p>
  
  <pre><code>var lastChanged = '' ;
  var lastUpdated = '' ;
  var poll ;
  function DBPoller()
  {
  poll = setTimeout(function(){
      connection.query('SELECT enquiryAdded FROM _table_updates', function(e, row) {
          if(e)
          {
              console.log('An error occured: '+e)
          }
          else
          {
              addedDate = dateFormat(row[0], 'yyyy-mm-dd hh:MM:ss') ;
              if(addedDate != lastChanged)
              {
                  console.log('An enquiry was just added at '+addedDate+', the one before this was at '+lastChanged) ;
                  lastChanged = addedDate ;
              }
          }
      });
      DBPoller() ;
  }, 2000)
  }
  </code></pre>
  
  <p>The above gives me the "Invalid date" error.</p>
  
  <p>What am I missing?</p>
  
  <hr>
  
  <p>Hi, the mysql column datatype is DATETIME.</p>