I want to save a JavaScript code into a parameter so I can validate the most current date. This is how it looks:
d = new Date(); weekday = new Array(7); weekday[0] = “Sun”; weekday[1] = “Mon”; weekday[2] = “Tue”; weekday[3] = “Wed”; weekday[4] = “Thu”; weekday[5] = “Fri”; weekday[6] = “Sat”; the_weekday = weekday[d.getDay()]; month = new Array(); month[0] = “Jan”; month[1] = “Feb”; month[2] = “Mar”; month[3] = “Apr”; month[4] = “May”; month[5] = “Jun”; month[6] = “Jul”; month[7] = “Aug”; month[8] = “Sep”; month[9] = “Oct”; month[10] = “Nov”; month[11] = “Dec”; the_month = month[d.getMonth()]; the_day = d.getDate(); the_full_year = d.getFullYear(); d = "Updated: " + the_weekday + ", " + the_month + " " + the_day + ", " + the_full_year;
This is the text on the page: “Updated: Tue, Nov 12, 2019”.
Is it possible to do this or is there another solution I can do to validate the date? Thank you.