fajarsiddiqfs
4 months ago

Automatically Update Your Website Footer

👨‍💻Automatically updating copyright year or other dynamic timestamp. ✅Just copy a code snippet _

💻JavaScript Snippets - For Static Sites <script type="text/javascript"> document.write(new Date().getFullYear()); </script>

😻It will show > 2019

If you want a bit more information, here's a snippet you can customize: &copy; 2010<script>new Date().getFullYear()>2010&&document.write("-"+new Date().getFullYear());</script>, Company.

It will give you: © 2010-2019, Company. _

💻PHP Snippets - For Dynamic Sites <?php echo date("Y"); ?>

😻It will show > 2019

If you want a bit more information, here's a snippet you can customize: &copy; <?php $fromYear = 2008; $thisYear = (int)date('Y'); echo $fromYear . (($fromYear != $thisYear) ? '-' . $thisYear : '');?> Company. It will give you: © 2010-2019, Company.

Do you have any comment on this tricks? then let the author know about that. comment here