Web Design & Development

How To Calculate “Year Since” Via JQuery

If you’re building a WordPress website and find you need to calculate “year since” via jQuery, the following is an ideal code for that.

An example can be found here: jsfiddle.net/Garconis/fcar9vjn.

Note: You may need to replace $ with jQuery if using within WordPress.

function yearsSince() {
var d = new Date();
var sinceThen = d.getFullYear()-1979;
$(document).ready(function() {
1979 is <span id="sinceDate">35+</span> years today.

Need Help?

Tell us about your project!

  • Date Format: MM slash DD slash YYYY
Previous Post
Helpful Troubleshooting Resources For Web Developers
Next Post
DNS Propogation Checker

Related Articles

Google Rating
Based on 54 reviews
Get a Quote