Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Is there a couch tag or a parameter I can use to get the previous date (yesterday date) instead of using PHP like this in my couchCMS code.

Code: Select all
<!-- Today date -->
<cms:set today_date="<cms:date format='Y-m-d' />" />

<!-- Yesterday date -->
<cms:set yesterday_date="
    <cms:php >
        $dt = new DateTime();
        $dt->sub(new DateInterval('P1D'));
        echo $dt->format('Y-m-d');
    </cms:php>
" />

Thanks.
Code: Select all
<!-- Yesterday date -->
<cms:set yesterday_date="<cms:date 'yesterday' format='Y-m-d'/>" />


Here is a post with more relative dates viewtopic.php?f=8&t=10559&hilit=date+yesterday#p28383
Also date comparison example https://github.com/trendoman/Midware/bl ... comparison
Join COUCH:TALK channel here https://t.me/couchcms_chat
Ryazania — a framework to boost productivity with Add-ons viewtopic.php?f=2&t=13475
Support my efforts to help the community https://boosty.to/trendo/donate
Thank you @trendoman :) . Every time I have a problem and then learn that CouchCMS has thought all about it, I fall in love with Couch all over again :D
3 posts Page 1 of 1