title: What is the proper way to use the `Sequelize.fn` method to format a SQLite3 datetime?
body: <p>I'm experimenting with Sequelize.js using both a MySQL and a SQLite3 database and displaying the data in JSON format in the console.  With MySQL, the <code>Sequelize.fn</code> function enables me to control the format of the <code>createdAt</code> and <code>updatedAt</code> fields like this:</p>
  
  <pre><code>[Sequelize.fn('date_format', Sequelize.col('updatedAt'), '%m-%d-%Y %H:%i:%s'), 'updatedAt']
  </code></pre>
  
  <p>For example:</p>
  
  <pre><code>Article.findAll({
      attributes: [
          'id',
          'title',
          'body',
          [Sequelize.fn('date_format', Sequelize.col('createdAt'), '%m-%d-%Y %H:%i:%s'), 'createdAt'],
          [Sequelize.fn('date_format', Sequelize.col('updatedAt'), '%m-%d-%Y %H:%i:%s'), 'updatedAt']
      ]
  })
      .then(tasks =&gt; {
          console.log(JSON.stringify(tasks, null, 2))
      })
  </code></pre>
  
  <p>returns this:</p>
  
  <pre><code>  {
      "id": 27,
      "title": "This is a test title",
      "body": "The main body of the article appears here.",
      "createdAt": "05-28-2017 23:41:42",
      "updatedAt": "05-28-2017 23:41:42"
    }
  </code></pre>
  
  <p>SQLite, however, does not recognize the <code>date_format</code> function and throws an error:</p>
  
  <pre><code>Unhandled rejection SequelizeDatabaseError: SQLITE_ERROR: no such function: date_format
  </code></pre>
  
  <p>Research suggests that the correct SQLite function is <code>strftime</code>, but although no error message appears, the output is <code>null</code>.  For example, </p>
  
  <pre><code>[Sequelize.fn('strftime', Sequelize.col('updatedAt'), '%m-%d-%Y %H:%i:%s'), 'updatedAt']
  </code></pre>
  
  <p>results in</p>
  
  <pre><code>{
    "id": 42,
    "title": "Hello world!",
    "body": "This is stored in SQLite!",
    "createdAt": "2017-05-28T23:19:41.738Z",
    "updatedAt": null
  }
  </code></pre>
  
  <p>Can anyone point me in the right direction?</p>