0

(I also asked this question over on StackOverflow and got answers related to unit testing my own programs, which is similar to but is not the same as this question).

Is there a way to change the date and time seen by a specific process as opposed to the entire computer? For instance, is there a way to make it so that while my OS, Dropbox client, Git build, and web browser all know what the correct time is on my computer and react accordingly, a single process on my computer that I select believes that it's Christmas or my son's birthday or 3 in the morning, returning all time() calls and stamping dates on saved files accordingly?

One use case I can think of (though admittedly not very serious) would be activating the "So Sorry" monster in Undertale, which only appears when you enter his room while the system time is set to October 10th at 8 PM - I would want to be able to do this without having to mess up the date-and-time sensitive functions of my aforementioned system programs (or worse, forget to turn it off and mess up other foreground programs, or have my OS sync it back for me while I'm in the game and miss the event).

1 Answer 1

2

A fast way to achieve what you ask could be to run your process inside a qemu, uml or other kind of virtualization software. On the virtual machine you can set the date/time you want, and then run your process.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .