This changes money by 1 every second. However, when you close the tab, it will keep collecting money for you when you come back! Try this by clicking the flag, clicking stop, waiting a few seconds, and clicking the flag again.
I used days since 2000 instead of current () to make it more accurate. Idea inspired by: https://www.coolmathgames.com/0-clicker-heroes