public static void Main()
GetSystemTimeZoneInformation();
GetTimeZoneInformation("GMT Standard Time");
GetTimeZoneInformation("Greenwich Standard Time");
public static void GetSystemTimeZoneInformation()
Console.WriteLine("---------");
Console.WriteLine($"The current system time (influenced by the executing system's configuration): {DateTime.Now}");
Console.WriteLine($"The current time as UTC: {DateTime.UtcNow}");
public static void GetTimeZoneInformation(string timeZoneName)
Console.WriteLine("---------");
Console.WriteLine(timeZoneName);
TimeZoneInfo timeZone = TimeZoneInfo.FindSystemTimeZoneById(timeZoneName);
Console.WriteLine($"UTC now is the following time in this zone: {TimeZoneInfo.ConvertTimeFromUtc(DateTime.UtcNow, timeZone)}");
Console.WriteLine($"Is this zone currently in daylight savings: {timeZone.IsDaylightSavingTime(DateTime.UtcNow)}");
Console.WriteLine($"Daylight savings name: {timeZone.DaylightName}");