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.

strtotime() weirdness...

August 06, 2008 8:48pm

Subscribe [2]
  • #1 / Aug 06, 2008 8:48pm

    Benjamin Katz

    20 posts

    Hey all…

    This works:

    $today = '{current_time format="%Y-%m-%d"}';
    echo strtotime($today);

    This doesn’t:

    $expiration = '{expiration_date format="%Y-%m-%d"}';    
    echo strtotime($expiration);

    The latter doesn’t “echo” anything out.  Any idea as to why this is happening?

  • #2 / Aug 07, 2008 12:33am

    Derek Jones

    7561 posts

    The first example would work with PHP on either Input or Output parsing, because the current time variable is parsed before tags.  Expiration date is a tag’s variable, so it would only work if PHP was set to be parsed on Output stage parsing.

  • #3 / Aug 07, 2008 10:05am

    Benjamin Katz

    20 posts

    Ahh, didn’t even think to consider the parsing stage.  Thanks Derek!  You guys are too good.

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

ExpressionEngine News!

#eecms, #events, #releases