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.

Compare two dates

May 03, 2012 5:50pm

Subscribe [2]
  • #1 / May 03, 2012 5:50pm

    nroptions

    46 posts

    I want to determine if the entry date of a channel entry is “recent”, say within “x” days. Is there any way within basic EE code (i.e., not using PHP) to do this, essentially to use arithmetic in a conditional?  Or do I need to use an add-on such as MX Calculator? 

    Thanks.

    Jonathan

  • #2 / May 03, 2012 6:46pm

    the3mus1can

    426 posts

    You will need to use PHP in the template or an add-on like MX Calculator to do the math.  If you look at the docs for start_on (http://ellislab.com/expressionengine/user-guide/modules/channel/channel_entries.html#start-on) they PHP in the template to achieve what you are trying to, but you might be able to use MX Calculator to do it too. Or you could write your own plugin that returns the appropriate dateime to pass into the start_on param.

  • #3 / May 03, 2012 9:49pm

    nroptions

    46 posts

    OK, thanks for the info.

    Jonathan

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

ExpressionEngine News!

#eecms, #events, #releases