DateTime localTime = DateTime.Now; TimeZoneInfo localZone = TimeZoneInfo.Local; DateTime utcTime = TimeZoneInfo.ConvertTimeToUtc(localTime, localZone); Console.WriteLine("Local Time: {0}", localTime); Console.WriteLine("UTC Time: {0}", utcTime);
TimeZoneInfo localZone = TimeZoneInfo.Local; Console.WriteLine("Current Time Zone: {0}", localZone.DisplayName);This example uses the Local property of the TimeZoneInfo class to retrieve the current time zone, and then displays its display name using the DisplayName property. Package Library: System.Core.dll