Propaganda Party: The Pop Stalin Design Manifesto

 

4 People Have Bloviated

  1. Dave Bowker | Jan 14

    That’s a little bloated for displaying the year. I’ve used a similar effect on all my sites…

    <?php echo date(‘Y’); ?>

  2. Jen | Jan 14

    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.

  3. Ian Ferguson | Jan 18

    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).

    1. < ?php
    2. ini_set('date.timezone','America/New_York');
    3. echo (($thisYear=date('Y'))>($startYear=2000))?$startYear."–".$thisYear:$startYear;
    4. ?>
  4. Jen | Jan 19

    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.