Hi I am trying to change the date and time settings for my machine to a date in the future. however this is causing it to just increase by a day and cause a long delay from running my tests
- I have tried seeing if there was a registry entry I could use to modify time
public void ChangeDate()
{
Process p = new Process();
p.StartInfo.WindowStyle = ProcessWindowStyle.Hidden;
p.StartInfo.FileName = "cmd.exe";
ProcessStartInfo commandInfo = new ProcessStartInfo("cmd.exe");
commandInfo.WorkingDirectory = @"c:\Windows\System32\";
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.Verb = "runas";
p.Start();
p.StandardInput.WriteLine(@"cd c:\Windows\System32");
p.StandardInput.WriteLine("date 12-10-2019");
p.WaitForExit();
Console.WriteLine("Time Has Changed");
expected results: The date to change to 12-10-2019. actual results: Specflow Feature file hangs. Date is forwarded by one day. Todays date is 08/09/2019 so it changes to 08/10/2019