'Issue with dates in Node.js proxy

I am attempting to edit an open source "Time Travel" proxy so it can run 24/7 and have current month and date but past year. When I attempted this it did the correct year but the date and month was the earliest it could be, even though there was archives for current day. Sorry if I am explaining this horribly, I do not have much experience with node.js.

I will put the offending code below, and the whole program as a linked file.

Want to quickly make it clear that the original code is not mine, I am only attempting to edit it.

let date_ob = new Date();

let date = date_ob.getDate();
let month = date_ob.getMonth() + 1;
let year = 2010;
/* format for destination date is yyyyMMdd */
const TIME_TRAVEL_DATETIME = (2010 + month + date);

Whole program linked here



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source