title: How to subtract two dates in Mongo
body: <p>Consider this code. I have this query in a 3T Studio aggregate query.</p>
  
  <pre><code>{
      "book.newpublisheddate": {$subtract : [ {$date: "book.published"}, {$date: "1970-01-01T00:00:00.000+0000"}] }
  }
  </code></pre>
  
  <p>I cannot use code like <code>{$subtract : [ "book.published", new Date()] }</code> because it says it is not valid json. I am using mongo 3.6.13.</p>