EDIT: date Instead of the_time
If you wanna use the current year for a copyright statement or whatever and not have to update it every year (if you’re that lazy
) Here’s how:
If you’re in a WordPress environment:
1 | <?php the_time('Y'); ?> |
Output: 2008
(Yes, I can execute PHP in my posts.)
And in any normal .php page, you can get the year from your server.
1 | <?php echo date('Y'); ?> |
Output: 2010
So on exactly 31/12/2008 11:59, it’ll be 2010, and the next minute, well.. you know what’s gonna happen.
No related posts.
Thanks, this was helpful!
Comment by Kathy on March 25, 2010 at 6:31 pm