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.

Changing the displayed date?

September 12, 2013 4:14pm

Subscribe [3]
  • #1 / Sep 12, 2013 4:14pm

    LI Pulse

    2 posts

    Possibly an odd request, but i’m looking for a way for the system-generated month to display for the month *after* it was actually posted. For example, if {entry_date format=' %F %Y '} produced “June” I would like it to read “July” when rendered.

    The reason is I work for a magazine, and we upload articles at the very end of the month, just before the issues hit shelves. So the article I post on June 25th is for the July issue, so we’d like the listings to read for the month the issue posts, not the day I actually post it in this case.

    It’s for this page if anyone needs a reference (the previous articles):
    http://www.lipulse.com/art-music/category/music-lucky-13

    So the first article should read September 2013 instead of August. I hope this makes sense… thanks in advance for the help!

  • #2 / Sep 13, 2013 9:01am

    worfoual

    61 posts

    When you make a new entry you can change the “Entry Date”.
    You make a new entry the 28 of june but you enter in the “Entry Date” the 1 of july.

    Or do you mean something else?
    Francois

  • #3 / Sep 13, 2013 9:28am

    LI Pulse

    2 posts

    When you make a new entry you can change the “Entry Date”.
    You make a new entry the 28 of june but you enter in the “Entry Date” the 1 of july.

    Or do you mean something else?
    Francois

    Something else…

    The articles should appear when I post them, I just want the month listed on the link I included above to read as one month *after* they get posted. So there’s no delay in when they publish, but on that one page the date basically reads as “Month +1”.

  • #4 / Sep 13, 2013 9:30am

    Bhashkar Yadav

    727 posts

    Hi LI,

    This can be achieved with PHP code:

    <?php
    $entry_date = "{entry_date}";
    echo date("F Y", strtotime("+1 month", $entry_date));
    ?>

    With the above, set following preferences for that template:
    Allow PHP? = “Yes”
    PHP Parsing Stage = “Output”

    I hope, it would help you.

  • #5 / Sep 13, 2013 9:43am

    worfoual

    61 posts

    I’ve never try this one but maybe it can help:
    http://viminteractive.com/software/dt_plugin/

    But the solution from Bhashkar looks perfect

    Francois

  • #6 / Sep 13, 2013 10:37am

    LI Pulse

    2 posts

    Bhashkar - That seemed to do it! Thank you so much!!!

    Worfoual - I’ll look into that plugin as well, I didn’t find that during my searches for an answer. Thank you as well!

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

ExpressionEngine News!

#eecms, #events, #releases