Change the time zone on a Windows VM

You can use DCS capabilities when you need to perform a test with the client machine in a time zone other than UTC (default).

Step-by-step guide

  1. Run the "tzutil /l" command on any Windows machine in order to get a list of available timezone.
  2. Add the DCS capabilities to your script as in example below using a needed time zone:
  3. Copy
    Map<String, Object> resourceArgs = new HashMap<>();
    resourceArgs.put("timeout", 120);
    String[] timezone =  new String[]{"GMT Standard Time"};
    resourceArgs.put("newtimezone", timezone);
    capabilities.setCapability("customizationScript", "pm-change-tz.yml");
    capabilities.setCapability("customizationScriptArgs", resourceArgs);

See also the Perfecto Knowledgebase.