Anyone know how to have an auto updating date script that shows 2 days before the current date? Like instead of 13 August 2020 it would show 11 August 2020...
I tried messing around with this date script i normally use for way too long:
header:
<script type="text/javascript">
/*=============HELPER================*/
var Helper = (function() {
var data = [];
var months = ['January','February','March','April','May','June', 'July','August','September','October','November',' December'];
var days = ['Sunday','Monday','Tuesday','Wednesday','Thursday' ,'Friday','Saturday'];
function setDays(d) {
if ((d.constructor !== Array) || d.length !== 7)
return false;
days = d;
}
function setMonths(m) {
if ((m.constructor !== Array) || m.length !== 12)
return false;
months = m;
}
function getDate() {
var now = new Date();
var month = typeof(months[now.getMonth()]) == 'undefined' ? now.getMonth() : months[now.getMonth()];
return (now.getDate()) + " " + month + " " + now.getFullYear();
}
function getMonth() {
var now = new Date();
var month = typeof(months[now.getMonth()]) == 'undefined' ? now.getMonth() : months[now.getMonth()];
return month;
}
function getDay() {
var now = new Date();
var day = typeof(days[now.getDay()]) == 'undefined' ? now.getDay() : days[now.getDay()];
return day;
}
function getDayOfMonth() {
var now = new Date();
var day = ('0' + now.getDate()).slice(-2);
return day;
}
function getUrlParameter(name) {
name = name.replace(/[\[]/, '\\[').replace(/[\]]/, '\\]');
var regex = new RegExp('[\\?&]' + name + '=([^&#]*)');
var results = regex.exec(location.search);
return results === null ? '' : decodeURIComponent(results[1].replace(/\+/g, ' '));
}
function findAncestor(element, name) {
while ((element = element.parentElement) && !element.classList.contains(name));
return element;
}
function bindOnQuery(query, callback, action = 'click') {
var elements = document.querySelectorAll(query);
for (var i = 0; i < elements.length; i++) {
elements[i].addEventListener(action, callback, false);
}
}
function bindOnId(name, callback, action = 'click') {
var element = document.getElementById(name);
element.addEventListener(action, callback, false);
}
function replaceMarkers(text, markers) {
for (key in markers) {
var search = '%'+ key +'%';
text = text.replace(new RegExp(search, 'g'), markers[key]);
}
return text;
}
return {
setDays: setDays,
setMonths: setMonths,
getDate: getDate,
getDay: getDay,
getMonth: getMonth,
getDayOfMonth: getDayOfMonth,
getUrlParameter: getUrlParameter,
findAncestor: findAncestor,
bindOnQuery: bindOnQuery,
bindOnId: bindOnId,
replaceMarkers: replaceMarkers
};
})();
</script>
callout:
<script>document.write(Helper.getDate())</script>
The settings of this forum section prevented your thread from being published... corrected it now and should be visible. Let's see if anyone can offer help 
Here is a script that will display the date of today with a shift of days_change. It use .toLocaleString, which allows to have the date in the correct language without having to use a lot of arrays with days of the week, months... in each language. Edit: see my post below for more info.
<script>
var date = new Date();
days_change = -2;
date.setDate(date.getDate() + days_change);
const formattedDate = date.toLocaleString("en-GB", {
day: "numeric",
month: "long",
year: "numeric",
});
document.write(formattedDate);
</script>
Jeremie for the rescue! Thanks a ton man! 
Wow thanks jeremie that worked right away! Excellent 
One more quick tip as I played a bit more with the script.
It also works with only the 2-letter ISO code of the language.
See for example:
date.toLocaleString("fr", {
date.toLocaleString("es", {
date.toLocaleString("ru", {
these 3 lines of code
days_change = 2;
var date = new Date(Date.now() - 24 * days_change * 60 * 60 * 1000);
new Date(Date.now() - 1728e5);
but probably not a lot lol

var days_change = -2;
var sta1 = performance.now();
for (var p = 0; p < 10000; p++) {
var date1 = new Date();
date1.setDate(date1.getDate() + days_change);
}
var end1 = performance.now();
var sta2 = performance.now();
for (var p = 0; p < 10000; p++) {
var date2 = new Date(Date.now() - 24 * days_change * 60 * 60 * 1000);
}
var end2 = performance.now();
console.log('Time 1: ' + (end1 - sta1) + ' ms.');
console.log('Time 2: ' + (end2 - sta2) + ' ms.');
So will Taboola allow this? Right now they are denying landers for auto updating date stamp.