// GetTimeZoneReport.cs // // Reports Time Zone Settings via WMI (Win32_TimeZone). // // Requires the System.Management package: // dotnet new console -o TimeZoneReport // dotnet add package System.Management // (replace the generated Program.cs with this file, then dotnet run) // On .NET Framework, System.Management is already available — just // add a reference to it in your project. using System; using System.Management; var searcher = new ManagementObjectSearcher("SELECT Description, Bias, StandardName FROM Win32_TimeZone"); int count = 0; foreach (ManagementObject item in searcher.Get()) { Console.WriteLine($"Description: {item["Description"]}"); Console.WriteLine($"Bias: {item["Bias"]}"); Console.WriteLine($"StandardName: {item["StandardName"]}"); Console.WriteLine(new string('-', 40)); count++; } if (count == 0) { Console.WriteLine("No Time Zone Settings found."); } else { Console.WriteLine($"\n{count} Time Zone Settings found."); }