title: React Native: How to save date in realm DB
body: <p>My realm model is:</p>
  
  <pre><code>const itemsSchema = {
      name: 'items',
      properties: {
          key: 'int',
          business_id: 'int',
          item_id: 'int',
          item_name: 'string',
          item_price: 'float',
          datetime: 'date'
          // datetime: 'string'
      }
  };
  </code></pre>
  
  <p>I want to save the current date every time user hits a save button and this is the code executed on save which saves the data if I make my model property <code>datetime: 'string'</code></p>
  
  <pre><code>realm.write(() =&gt; {
      realm.create('items', {
          key: 0,
          business_id: QRData.business_id,
          item_id: QRData.item_id,
          item_name: QRData.item_name,
          item_price: QRData.item_price,
          datetime: new Date('2017-06-06 21:23:53')
      });
  });
  </code></pre>
  
  <p>But if try to save it with model property set as <strong>date</strong> it throws this error:</p>
  
  <p><strong>Error: Value 'Invalid Date' not convertible to a number.</strong></p>