How can I execute a command making it believe that is on a different date than system one?
For instance, if I have this script:
#!/usr/bin/env bash date +"%B %d, %Y"
It prints the actual date: march 13, 2014
But I would like it to print a different date, on the future or past, without changing the system date.
If I wasn’t clear enough, I want a command line tool like this Windows GUI tool.
I do not want to use a different script (it was just an example).
I do not want to set a cronjob.
I do not want to change my general system date.
Only change the date that apply to the command to run.
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
Using the libfaketime software could be a solution
sudo apt-get install faketime faketime '2006-09-20' wine Example.exe
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0