title: How to filter by date/time in Google App Engine Datastore using GoLang
body: <p>I'm working on a golang backend run on Google App Engine. I have an Entity called <code>Recruit</code> that has a property</p>
  
  <pre><code>UpdatedAt time.Time `datastore:"updated_at"`
  </code></pre>
  
  <p>I would like to query Recruits by their updated time. My first instinct is to use a <a href="https://developers.google.com/appengine/docs/go/datastore/queries#Go_Filters" rel="nofollow">filter</a>. </p>
  
  <pre><code>query = datastore.NewQuery("Recruit").Filter("updated_at &lt;=", updatedAt)
  </code></pre>
  
  <p>where updatedAt is a string. I've tried the forms <code>2014-08-28 01:53:19</code> and <code>2014-08-28T01:53:19.00618Z</code> (The former is the form the time.Time property takes in the datastore, while the latter is how it propagates in JSON.)</p>
  
  <p>When I call the query with <code>&lt;=</code>, all Recruit objects are returned. When calling with <code>&gt;=</code>, null is returned. I'm quite sure I'm testing with a time in the middle of the data set.</p>
  
  <p>When I test on console.developers.google.com, the console filters support <code>a date and time</code> <code>after/before</code>, but trying to replace <code>&lt;=</code> with <code>after</code> results in an error.</p>
  
  <p>Has anyone managed to filter queries by date or time?</p>