The source code to get the hash code of the time zone is given below. The given program is compiled and executed successfully.
using System;
using System.Globalization;
using System.Collections.ObjectModel;
class TimeZoneInfoDemo
{
//Entry point of Program
static public void Main()
{
//Create object of date and time format.
DateTimeFormatInfo datTimeFormat;
//Create collection for timezones
ReadOnlyCollection<TimeZoneInfo> ListOftimeZones;
datTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat;
ListOftimeZones = TimeZoneInfo.GetSystemTimeZones();
Console.WriteLine("HashCodes: ");
foreach (TimeZoneInfo time_zone in ListOftimeZones)
{
Console.WriteLine("\t"+time_zone.GetHashCode());
}
}
}
Program:
The source code to get the hash code of the time zone is given below. The given program is compiled and executed successfully.
Output: