In Linux, there is this nice little command line tool called "faketime" (see, e.g., https://www.systutorials.com/docs/linux/man/1-faketime/). It let's you run a program with a different system time, so, e.g.
faketime '2008-12-24 08:15:42' python test.py
starts test.py, but for the script the current time is the one given as a parameter. After the start, the time progresses as normal, so this is perfect for testing code that depends on the actual time.
Is it possible to run a script within PyCharm like that? How?