My function looks like this:
$(document).ready(function(){
var d = new Date(document.lastModified);
// document.getElementById("lastup").innerHTML = d;
$("#lastup").html(d);
// Create a version number based on the date
var cy = new Date();
var y = cy.getFullYear()-2015; // ex: 2018 - 2015 = 3 third year of program
var mo = d.getMonth()+1; // ex: 2 = Feb
var dy = d.getDate(); // ex: 12 = Date of month
var v = 'v'+y+'.'+mo+'.'+dy; // ex: v3 = third year of program
$("#version2").html(v); // ex: v3.2.12
});
The goal being to create a version number based on the last time the page code was changed. You can see the year part is based on years the program has been in place. But the month and day take there values from 'd' which is the value of "new Date(document.lastModified)" put it all together and you get a version number. But in this case it gives me a new version number for every day, it does not hold the last modified data, it always increments based on the date. Somewhere I'm not seeing the obvious here. Why is it doing this?