Как это сделать? – есть два простых сниппета

1-й на Javascript:

<script>new Date().getFullYear()>2010&&document.write("-"+new Date().getFullYear());</script>

2-ой на PHP:

<?php 
  $fromYear = 2008; 
  $thisYear = (int)date('Y'); 
  echo $fromYear . (($fromYear != $thisYear) ? '-' . $thisYear : '');
?>

Комментарии

Leave a Reply

Your email address will not be published. Required fields are marked *