Longform thoughts of @rajasimon

How to update the footer year HTML Dynamically?

Published 3 Jan, 2022


Use a simple javascript line to update the footer html easily every year.

Why?

When comes to static blog page or any website that no longer needs updates needs one particular update in every year which is updating the footer year. This update needs some one have to commit to the file and push it to the frontend but this is lot of works right? How we can simply this so that we don’t have to update every year ah?

How?

Well, I’m sharing how to do those things here in this page which is very easy and you can copy paste in your html which will work like magic 🪄

const thisYear = new Date().getFullYear()

Conclusion

Here we go now that you know the code about how to get the current year you can add this in your html and you will happily ever after.

This article published under development on javascript tags. Please subscribe below forms to receive articles.


Join the Newsletter

Subscribe to get our latest content by email.
    We won't send you spam. Unsubscribe at any time.