I just want to point out that both Date and RealDate reference the same object, so when you replace the function Date.now, it's also changing RealDate.now and your global.Date = RealDate at the end is not doing what you think it's doing.
global.Date = RealDate
What you should do if you want to keep and reassign the original now function is keep a reference to that function:
const realNow = Date.now
Date.now = () => 1000
Date.now = realNow
🙊Oh! You're completely right! Thank you so much, I will update my post!!! :)
(sorry for the late answer, I didn't saw the notification...)
We're a place where coders share, stay up-to-date and grow their careers.
We strive for transparency and don't collect excess data.