Answers.Body: <p>You concatenate the strings <code>'&gt;='</code> and what is output from the <code>timeLimit</code> var (the same as <code>{{ timeLimit }}</code> does). So it gets concatenated to <code>'&gt;=2014-08-22'</code>.</p>
  
  <p>You need to change two things. First add a space after the comparison operator and second, change the date output to include the time by using the <a href="http://twig.sensiolabs.org/doc/filters/date.html" rel="nofollow"><code>date</code></a> filter. I suggest to use  <code>'c'</code> as the value for the formatting parameter, as it returns the datetime ISO 8601 formatted.</p>
  
  <pre><code>{% set timeLimit = now|date_modify('-2 min') %}
  
  {# Get entries with `dateUpdated('&gt;= 2014-08-22T01:55:00+02:00')` #}
  {% set updated = craft.entries.dateUpdated('&gt;= ' ~ timeLimit|date('c')) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-08-21T23:43:00.497Z
Answers.LastActivityDate: 2014-08-21T23:54:07.227Z
Answers.LastEditDate: 2014-08-21T23:54:07.227Z
Answers.UserDisplayName: carlcs
Body: <p>I'm trying to grab all Entries that were updated after a given date and time.</p>
  
  <p>It seems like I can grab all entries updated after a <em>date</em> using the following:</p>
  
  <pre><code>{% set timeLimit = now | date_modify("-2 min") %}
  {% set updated = craft.entries({ dateUpdated: '&gt;=' ~ timeLimit }).section('myChannel') %}
  </code></pre>
  
  <p>The problem is, that code doesn't actually seem to take time into account at all, just date. <code>timeLimit</code> in the above will always return something like <code>2014-08-21</code>.</p>
  
Tags: <entries><datetime>
Title: Fetch all entries with dateUpdated after a given time
ThreadText: # Fetch all entries with dateUpdated after a given time
  
  (Asked by: username_0 on 2014-08-21)
  
  I'm trying to grab all Entries that were updated after a given date and time.
  
  It seems like I can grab all entries updated after a *date* using the following:
  
  ```
  {% set timeLimit = now | date_modify("-2 min") %}
  {% set updated = craft.entries({ dateUpdated: '>=' ~ timeLimit }).section('myChannel') %}
  
  ```
  
  The problem is, that code doesn't actually seem to take time into account at all, just date. `timeLimit` in the above will always return something like `2014-08-21`.
  
  **Tags:** entries, datetime
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-08-21. Score: 2 | Accepted answer
  
  You concatenate the strings `'>='` and what is output from the `timeLimit` var (the same as `{{ timeLimit }}` does). So it gets concatenated to `'>=2014-08-22'`.
  
  You need to change two things. First add a space after the comparison operator and second, change the date output to include the time by using the [`date`](http://twig.sensiolabs.org/doc/filters/date.html) filter. I suggest to use `'c'` as the value for the formatting parameter, as it returns the datetime ISO 8601 formatted.
  
  ```
  {% set timeLimit = now|date_modify('-2 min') %}
  
  {# Get entries with `dateUpdated('>= 2014-08-22T01:55:00+02:00')` #}
  {% set updated = craft.entries.dateUpdated('>= ' ~ timeLimit|date('c')) %}
  
  ```
  
  
  ---
  
  