ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

if current time equals entry date -- proper syntax?

June 14, 2012 12:07pm

Subscribe [2]
  • #1 / Jun 14, 2012 12:07pm

    jeramiah

    301 posts

    Hey guys, just wanted to know how to pull this off - I want to display entries that only have today’s date:

    {if current_time format="%D, %F %d, %Y" == entry_date format="%D, %F %d, %Y"}
    Then show this content
    {/if}

    Obviously that code isn’t working but I was wondering if it was close. 

     

    ***EDIT***

    What about:

    {exp:channel:entries channel="{my_weblog}" sort="desc" start_on="{current_time format='%Y-%m-%d %H:%i'}" show_future_entries="yes"}
  • #2 / Jun 14, 2012 12:40pm

    boldyellow

    89 posts

    Can you call your entries in a channel loop with year, month, day?

    {exp:channel:entries channel="{my_channel}" year="{0000}" month="{00}" day="{00}"  }
  • #3 / Jun 14, 2012 12:46pm

    jeramiah

    301 posts

    Right but that would entail hardcoding the dates in and it needs to by dynamic to always show today’s date.  Actually I think the parameter start_on=”{current_time format='%Y-%m-%d %H:%i'}” is going to work out.  Thanks though 😉

  • #4 / Jun 14, 2012 12:54pm

    boldyellow

    89 posts

    Yes, I would not hard code (I’ve used as URL segments), but couldn’t you just use the gv current time format, like…

    year = "{current_time format='%Y'}" ... etc…

    I have not tested, but seems like it should work?

  • #5 / Jun 14, 2012 1:35pm

    jeramiah

    301 posts

    True!  I’ll give this a shot thanks!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases