title: How to filter Realm objects via an NSDate property
body: <p>I'm trying to filter Realm objects to find those with <code>createdAt</code> dates less than year ago:</p>
  
  <pre><code>let datex = NSCalendar.currentCalendar().startOfDayForDate(NSDate()).dateByAddingTimeInterval(-1*365*24*60*60)
  let list = RealmDB.objects(TaskList).filter("createdAt &lt;= '\(datex)'")
  </code></pre>
  
  <p>I'm getting the following error:</p>
  
  <blockquote>
    <p>Expected object of type date for property 'createdAt' on object of type 'TaskList', but received: '2015-03-19 21:00:00 +0000'</p>
  </blockquote>
  
  <p>How do I fix this? It also looks like the date and time value are adjusted to time zone. How can I make sure the date is really the end of the day?</p>