© <span id="js-copyright-year">2023</span> My Product
<script>document.getElementById('js-copyright-year').innerHTML = new Date().getFullYear();</script>
Job's a good'un - if the user has JS disabled then they'll just see the year published as a fallback, otherwise it'll show 2024 when the new year rolls in.If using a templating engine or some SPA framework/library like React then just dynamically substitute there instead or similar in server-side rendered code.