How to auto update to the current year in footer Magento 2?

One possible hack can help us to modify the year dynamically.

Go to -> Admin -> General, choose Design -> Expand the Footer section and paste the below code.

Copyright © <script>document.write(new Date().getFullYear())</script> Magento. All rights reserved.

Remove the cache and check.


Place the following contents in this file:

{theme_dir}/Magento_Theme/templates/html/copyright.phtml

<?php /* @escapeNotVerified */ echo preg_replace('/(^|\s)(\d{4})(\s|$)/m', " ".date('Y'). " ", $block->getCopyright()); ?>

Place the following contents in this file: {theme_dir}/Magento_Theme/templates/html/copyright.phtml

<small class="copyright">
    <span>Copyright &copy; You <?php echo date('Y') ?>, All Rights Reserved.</span>
</small>

Then flush the cache.