PHP: Current Year

311th Oct 2010Development, PHP, , , , , ,

Every time I begin converting my designs to CMS-friendly PHP code, I always find myself trying to remember the best way to include the current year in copyright declarations for the footer. Of course it’s simple, and I always feel like an idiot when I eventually recall is.

So I’m putting it up here in the hopes that I won’t forget it in the future, and that others might be saved a trompe through some search listings. Without further adieu…

1
<?php echo( date( 'Y') ); ?>

Maybe now I’ll be able to remember this simple tidbit.

3 Comments Comments Feed

  1. Will B (October 12, 2010, 12:54 pm). Reply

    Can you post something a little shorter? I admit, I’m a lazy guy, and that much code is a bit much for my tired and lazy brain… 😛

  2. Anthony G. Cyphers (October 12, 2010, 3:20 pm). Reply

    The tired and lazy brain is what makes me forget the simplest functionality all the time. Though that shouldn’t be a problem soon. I’m building a design framework template for WordPress which should make my life a lot easier.

  3. Will B (October 21, 2010, 7:20 pm). Reply

    Thanks for this. I just used it right now on a WP blog for my son’s organization. 😀

Add a Comment

Before you post, please prove you are sentient.

What is 4 multiplied by 6?