My name’s Jen; I’m a cynical, sarcastic, ex-drummer who is fond of dark humor. I've held way too many factory & retail jobs but finally found my calling one Christmas holiday in a dark, musty basement. I am now a CSS & XHTML web standards looney and can be found daily—when I’m not at my Mac—at the local fair-trade coffee shop buying an iced-soy mocha no matter the temperature.
I am also the owner of Pop Stalin Design specializing in CSS & XHTML web design as well as custom WordPress themes.
That’s a little bloated for displaying the year. I’ve used a similar effect on all my sites…
<?php echo date(’Y'); ?>
Dave-Thanks for providing another way to do this. There are so many different methods for automating the date, I should have probably posted a few more.
Hey there! I realize that the supplied code snippet was meant to provide date ranges greater than $startYear; however, I think it’s still wise to account for $startYear being equal to $thisYear (2008–2008) — which would be redundant — as well as protect against any technical issues resolving the server’s timestamp (eg. 2008–1950).
< ?phpini_set('date.timezone','America/New_York');echo (($thisYear=date('Y'))>($startYear=2000))?$startYear."–".$thisYear:$startYear;?>Thanks for the tip, a much smarter way to handle it. I’m no PHP coding expert so sometimes I end up taking the long way around.