Loop based on date (with math) I would like to loop through entries only if the current date/time is before 5am on the following day from when the entry's eventDate (custom field mind you)is. 

In other words I may have an event at 10pm on May/1/2015 and i want to loop through that date as long as it is not 5am (or later) on May/2/2015.

What I have currently is this:

{% for slide in craft.entries.section('events').featured('1').order('dateTime asc').limit(5).find() if (slide.dateTime|date("c","+8hours")) &gt;= now|date("c") %}


However as you might have guessed, as far as i understand it, this loops through all entries as long as the current date/time is less than 8 hours AFTER the date/time of the event entry.

So to my understanding (Based on what i have observed) this will loop the entry up until 6am May/2/2015 which is not what i want.

In short. I'd like to ignore the 'time' portion of my date/time field as if it were May 1, 2015 12:00AM and add 29 hours, rather than including the time parameter of my date/time field and doing the math based on that which outputs variable results based on the time of the event.

Please let me know if i need to clarify any, I hope i've been clear. Also please let me know if there is anything else wrong with my For loop, it seems to work exactly how it should minus the date issue, but i'm always open to improvement.
You could try using the date_modify filter with a relative DateTime format:

{% if slide.dateTime|date_modify('tomorrow 5am')|date('U') &lt; now|date('U') %}


And if you want to limit the entries to be displayed, you should not use the limit parameter for that. Your
ElementCriteriaModel doesn't take your DateTime conditional into account, so it requires a custom solution:

{% set slides = craft.entries.section('events').featured('1').order('dateTime asc').limit(null) %}

{% set count = 0 %}
{% for slide in slides %}
    {% if count &lt; 5 and slide.dateTime|date_modify('tomorrow 5am')|date('U') &lt; now|date('U') %}
        {{ slide.dateTime }}
        {% set count = count + 1 %}
    {% endif %}
{% endfor %}