Get list of System Time Zone using c#

1. List of system time zone

            ReadOnlyCollection<TimeZoneInfo> tzCollection = TimeZoneInfo.GetSystemTimeZones();
2.  Get time against time zone

 Hashtable ht = new Hashtable();
        private void Form1_Load(object sender, EventArgs e)
            ReadOnlyCollection<TimeZoneInfo> tzCollection = TimeZoneInfo.GetSystemTimeZones();
            foreach (TimeZoneInfo timeZone in tzCollection)
               // comboBox1.Items.Add(timeZone.DisplayName.ToString());
                ht.Add(timeZone.DisplayName, timeZone.Id);
            comboBox1.DataSource = tzCollection;
 private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
            DateTime dd = TimeZoneInfo.ConvertTimeBySystemTimeZoneId(DateTime.Now, ht[comboBox1.Text].ToString());
            label1.Text = dd.ToString();



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s