I want to write some testscripts that create some files and execute commands that change behaviour depending on the current date. For testing purposes I would like to change the time to different dates (in the past and future) and check the behaviour.
Is it possible to change the date exclusively just for a singe shell-session, or fool a single application about the current date? - how could this be done?
The date command under UNIX displays date and time. You can use the same command set date and time. You must be the super-user (root) to change the date and time on Unix like operating systems. The date command shows the date and time read from the kernel clock.
this can be done to a program with libfaketime which is preload library i.e. LD_PRELOAD
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With