title: How to compare Google Appengine DateTime against a Date object in Java?
body: <p>I am new to Google Appengine. In my application, the datastore entities store a java.util.Date object. I want to query the datastore to return all the entities before a particular time. My code for this is :</p>
  
  <pre><code>Date date = new Date();
  Query&lt;Event&gt; query = ofy().load().type(Event.class).order("date");
  query = query.filter("date &lt;", date);
  </code></pre>
  
  <p>which upon execution, gives the error : <code>Invalid date/time format: Sat Apr 04 00:40:22 IST 2015</code></p>
  
  <p>If this format is invalid, which format do I need to use to query?</p>