I'm developing a desktop app for OS X with behaviour that depends on the date. I want to test the behaviour without waiting for a specific date.

I'd rather not change the date settings of the whole system as I'm worried it might mess with build systems etc. Using a VM is possible, but takes a while to set up.

Is there a simple way to run a process and its children in a time delta relative to the actual time, without affecting the rest of the system?

  • 1
    The real solution is to allow your code to override the date (make a function that gets the date, but when you're in development, override that function to always return a test date). – Andrew Larsson Oct 20 '15 at 14:46

No. The system doesn't bifurcate time.

You would need the app in question to handle the time shift or run independently of the system time or package the app to run in a VM or other container like docker. In some limited cases, the time zone variable might help you make a little tweak, but arbitrarily setting a totally unrelated time isn't implemented on OS X.

  • It's not possible to change the date by editing the Schemes ? I know that you can make a location simulation for example. ( CMD < ) – StrawHara Oct 20 '15 at 13:34
  • 1
    @MrMojoRisin Anything is possible with software :-). This isn't currently implemented, however. – bmike Oct 20 '15 at 13:36
  • @MrMojoRisin What's the Schemes? – jacwah Oct 20 '15 at 13:53
  • @jacwah Make a CMD + < in xcode ;) developer.apple.com/library/ios/recipes/… – StrawHara Oct 20 '15 at 13:55
  • 1
    @danielAzuelos Linux has time virtualization through UML (LWN). – jacwah Oct 21 '15 at 19:11

You must log in to answer this question.

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