Published by Mijingo

movie icon image

EE Insider Blog

Spend your time learning and developing sites with ExpressionEngine and we'll use this blog to keep you informed of all the news related to ExpressionEngine and CodeIgniter.

» Read more in the Archives.

» Have a tip? Send us your EE news.

Learn ExpressionEngine Today

Over a series of 8 videos, watch and learn as Ryan builds an entire ExpressionEngine website from beginning to end. Get started now.

Tip: Dynamically display Year from entries not from this year

EE Insider contributor Erik Reagan submitted a tip to the EE Insider Tips section of the site about displaying years for entries not from this year:

I personally hate going to blog sites and not knowing when an article was published. I often see ‘June 2’ but no year. Sometimes I’m actually interested in whether or not that means this June 2nd or last June second, or even a June from years ago.

Erik posted a simple code snippet to check for the date and then display the year if isn’t the current year. Be sure to read the entire tip for all of the info.

If you want to submit your own tips, head over to the EE Insider Tips section of the site and share your EE knowledge with the community. Submitting a tip requires a free account but also enables you to save tips by marking them as “helpful” and monitor comments on your own tips.

Posted on Apr 15, 2010 by Ryan Irelan

Filed Under: EE Insider Tips