views:

477

answers:

3

Does anybody know of a Windows tool to report fake dates/times to a process?

Apparently there are Linux programs that can be used to test how the software will react in the future / in a different timezone or to trigger scheduled tasks without actually modifying the system clock. Are there such programs for Windows?

+3  A: 

RunAsDate can do this.

nzpcmad
Awesome, thanks. Though it doesn't seem to affect the grand-child processes that the initial process might start, it is better than nothing.
Ishmaeel
A: 

Wrapper your calls to the 'getCurrentDateTime()' system calls so you can introduce offsets or multipliers into the times your code reads during testing?

RichH
A: 

Starting about 2 years ago, I always abstract the call to DateTime.Now (C#) through a Utility class. This way I can always fake the date/time if I want to, or just pass it directly through to DateTime.Now.

Sounds similiar to what BillH suggested.

public class MyUtil
{
  public static DateTime GetDateTime()
  {
     return DateTime.Now.AddHours(5);
     //return DateTime.Now;   
  }
}
tyndall