The fastest way of different date/time testing is changing the system clock, done :-), but if we don't want to change the system time, we can use Chrono Mock, CLI/GUI, open source app for time/date manipulation in apps: Download From GitHub, if you like the tool, please give it a star :-)
Changing app date/time without changing system clock
After launching the app, we need to chose the application that will be affected, we can just drag & drop the app:
Then we can just click the "Start" button, but... By design the date is set to 2038, so we need to set own custom date/time, and in "Date and time" section, same with "Speed and options":
Back up the application's data directory before your first future-dated session. The app will use a different time, so all saved data, saved files will have it
About the different settings in the time section, some of them can crash the app or break the GUI, it depends on the app, in some apps the time manipulation won't work without them, it all depends on the app type. Electron and WebView apps works too.
Date and time calculator for QA
OK, but what dates or time speed should we check? It all depends on what we want to check, there is "calculator" tab in the Chrono Mock, which got some pre-made presets and we can use own scenarios:

But watch out for an "time travel" problem, if you will first set "actul date + x", then you will go back to "actual date" or any "lower" date, your app can behave very strange, because it's not an normal case.
All things in this post can be done from CLI: https://chronomock.donislawdev.com/cli-reference/. I just tried to make this post as simple as possible, under the hood this is a bit more complex, and of course apps that are using time from the network won't be affected by Chrono Mock, it's out of the scope.


Top comments (0)