Pastebin launched a little side project called VERYVIRAL.com, check it out ;-) Want more features on Pastebin? Sign Up, it's FREE!
Guest

balexandre

By: a guest on Jan 12th, 2011  |  syntax: C#  |  size: 16.13 KB  |  views: 320  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. // ###########################
  2. // http://stackoverflow.com/questions/4668921
  3.  
  4.     public class TimeZoneInformation
  5.     {
  6.         public TimeZoneInformation(string id, string displayName, int diffMinutes, string daylightName, string stdName)
  7.         {
  8.             this.Id = id;
  9.             this.DisplayName = displayName;
  10.             this.UtcOffsetMinutes = diffMinutes;
  11.             this.DaylightName = daylightName;
  12.             this.StandardName = stdName;
  13.         }
  14.  
  15.         public string Id { get; set; }
  16.         public string DisplayName { get; set; }
  17.         public int UtcOffsetMinutes { get; set; }
  18.         public string DaylightName { get; set; }
  19.         public string StandardName { get; set; }
  20.     }
  21.  
  22. // ##########################
  23.  
  24. private List<TimeZoneInformation> ListAllTimeZones()
  25.     {
  26.         List<TimeZoneInformation> tz = new List<TimeZoneInformation>();
  27.  
  28.         tz.Add(new TimeZoneInformation("Dateline Standard Time", "(UTC-12:00) International Date Line West", -720, "Dateline Daylight Time", "Dateline Standard Time"));
  29.         tz.Add(new TimeZoneInformation("UTC-11", "(UTC-11:00) Coordinated Universal Time-11", -660, "UTC-11", "UTC-11"));
  30.         tz.Add(new TimeZoneInformation("Samoa Standard Time", "(UTC-11:00) Samoa", -660, "Samoa Daylight Time", "Samoa Standard Time"));
  31.         tz.Add(new TimeZoneInformation("Hawaiian Standard Time", "(UTC-10:00) Hawaii", -600, "Hawaiian Daylight Time", "Hawaiian Standard Time"));
  32.         tz.Add(new TimeZoneInformation("Alaskan Standard Time", "(UTC-09:00) Alaska", -540, "Alaskan Daylight Time", "Alaskan Standard Time"));
  33.         tz.Add(new TimeZoneInformation("Pacific Standard Time (Mexico)", "(UTC-08:00) Baja California", -480, "Pacific Daylight Time (Mexico)", "Pacific Standard Time (Mexico)"));
  34.         tz.Add(new TimeZoneInformation("Pacific Standard Time", "(UTC-08:00) Pacific Time (US & Canada)", -480, "Pacific Daylight Time", "Pacific Standard Time"));
  35.         tz.Add(new TimeZoneInformation("US Mountain Standard Time", "(UTC-07:00) Arizona", -420, "US Mountain Daylight Time", "US Mountain Standard Time"));
  36.         tz.Add(new TimeZoneInformation("Mountain Standard Time (Mexico)", "(UTC-07:00) Chihuahua, La Paz, Mazatlan", -420, "Mountain Daylight Time (Mexico)", "Mountain Standard Time (Mexico)"));
  37.         tz.Add(new TimeZoneInformation("Mountain Standard Time", "(UTC-07:00) Mountain Time (US & Canada)", -420, "Mountain Daylight Time", "Mountain Standard Time"));
  38.         tz.Add(new TimeZoneInformation("Central America Standard Time", "(UTC-06:00) Central America", -360, "Central America Daylight Time", "Central America Standard Time"));
  39.         tz.Add(new TimeZoneInformation("Central Standard Time", "(UTC-06:00) Central Time (US & Canada)", -360, "Central Daylight Time", "Central Standard Time"));
  40.         tz.Add(new TimeZoneInformation("Central Standard Time (Mexico)", "(UTC-06:00) Guadalajara, Mexico City, Monterrey", -360, "Central Daylight Time (Mexico)", "Central Standard Time (Mexico)"));
  41.         tz.Add(new TimeZoneInformation("Canada Central Standard Time", "(UTC-06:00) Saskatchewan", -360, "Canada Central Daylight Time", "Canada Central Standard Time"));
  42.         tz.Add(new TimeZoneInformation("SA Pacific Standard Time", "(UTC-05:00) Bogota, Lima, Quito", -300, "SA Pacific Daylight Time", "SA Pacific Standard Time"));
  43.         tz.Add(new TimeZoneInformation("Eastern Standard Time", "(UTC-05:00) Eastern Time (US & Canada)", -300, "Eastern Daylight Time", "Eastern Standard Time"));
  44.         tz.Add(new TimeZoneInformation("US Eastern Standard Time", "(UTC-05:00) Indiana (East)", -300, "US Eastern Daylight Time", "US Eastern Standard Time"));
  45.         tz.Add(new TimeZoneInformation("Venezuela Standard Time", "(UTC-04:30) Caracas", -270, "Venezuela Daylight Time", "Venezuela Standard Time"));
  46.         tz.Add(new TimeZoneInformation("Paraguay Standard Time", "(UTC-04:00) Asuncion", -240, "Paraguay Daylight Time", "Paraguay Standard Time"));
  47.         tz.Add(new TimeZoneInformation("Atlantic Standard Time", "(UTC-04:00) Atlantic Time (Canada)", -240, "Atlantic Daylight Time", "Atlantic Standard Time"));
  48.         tz.Add(new TimeZoneInformation("Central Brazilian Standard Time", "(UTC-04:00) Cuiaba", -240, "Central Brazilian Daylight Time", "Central Brazilian Standard Time"));
  49.         tz.Add(new TimeZoneInformation("SA Western Standard Time", "(UTC-04:00) Georgetown, La Paz, Manaus, San Juan", -240, "SA Western Daylight Time", "SA Western Standard Time"));
  50.         tz.Add(new TimeZoneInformation("Pacific SA Standard Time", "(UTC-04:00) Santiago", -240, "Pacific SA Daylight Time", "Pacific SA Standard Time"));
  51.         tz.Add(new TimeZoneInformation("Newfoundland Standard Time", "(UTC-03:30) Newfoundland", -210, "Newfoundland Daylight Time", "Newfoundland Standard Time"));
  52.         tz.Add(new TimeZoneInformation("E. South America Standard Time", "(UTC-03:00) Brasilia", -180, "E. South America Daylight Time", "E. South America Standard Time"));
  53.         tz.Add(new TimeZoneInformation("Argentina Standard Time", "(UTC-03:00) Buenos Aires", -180, "Argentina Daylight Time", "Argentina Standard Time"));
  54.         tz.Add(new TimeZoneInformation("SA Eastern Standard Time", "(UTC-03:00) Cayenne, Fortaleza", -180, "SA Eastern Daylight Time", "SA Eastern Standard Time"));
  55.         tz.Add(new TimeZoneInformation("Greenland Standard Time", "(UTC-03:00) Greenland", -180, "Greenland Daylight Time", "Greenland Standard Time"));
  56.         tz.Add(new TimeZoneInformation("Montevideo Standard Time", "(UTC-03:00) Montevideo", -180, "Montevideo Daylight Time", "Montevideo Standard Time"));
  57.         tz.Add(new TimeZoneInformation("UTC-02", "(UTC-02:00) Coordinated Universal Time-02", -120, "UTC-02", "UTC-02"));
  58.         tz.Add(new TimeZoneInformation("Mid-Atlantic Standard Time", "(UTC-02:00) Mid-Atlantic", -120, "Mid-Atlantic Daylight Time", "Mid-Atlantic Standard Time"));
  59.         tz.Add(new TimeZoneInformation("Azores Standard Time", "(UTC-01:00) Azores", -60, "Azores Daylight Time", "Azores Standard Time"));
  60.         tz.Add(new TimeZoneInformation("Cape Verde Standard Time", "(UTC-01:00) Cape Verde Is.", -60, "Cape Verde Daylight Time", "Cape Verde Standard Time"));
  61.         tz.Add(new TimeZoneInformation("Morocco Standard Time", "(UTC) Casablanca", 0, "Morocco Daylight Time", "Morocco Standard Time"));
  62.         tz.Add(new TimeZoneInformation("UTC", "(UTC) Coordinated Universal Time", 0, "Coordinated Universal Time", "Coordinated Universal Time"));
  63.         tz.Add(new TimeZoneInformation("GMT Standard Time", "(UTC) Dublin, Edinburgh, Lisbon, London", 0, "GMT Daylight Time", "GMT Standard Time"));
  64.         tz.Add(new TimeZoneInformation("Greenwich Standard Time", "(UTC) Monrovia, Reykjavik", 0, "Greenwich Daylight Time", "Greenwich Standard Time"));
  65.         tz.Add(new TimeZoneInformation("W. Europe Standard Time", "(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna", 60, "W. Europe Daylight Time", "W. Europe Standard Time"));
  66.         tz.Add(new TimeZoneInformation("Central Europe Standard Time", "(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague", 60, "Central Europe Daylight Time", "Central Europe Standard Time"));
  67.         tz.Add(new TimeZoneInformation("Romance Standard Time", "(UTC+01:00) Brussels, Copenhagen, Madrid, Paris", 60, "Romance Daylight Time", "Romance Standard Time"));
  68.         tz.Add(new TimeZoneInformation("Central European Standard Time", "(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb", 60, "Central European Daylight Time", "Central European Standard Time"));
  69.         tz.Add(new TimeZoneInformation("W. Central Africa Standard Time", "(UTC+01:00) West Central Africa", 60, "W. Central Africa Daylight Time", "W. Central Africa Standard Time"));
  70.         tz.Add(new TimeZoneInformation("Namibia Standard Time", "(UTC+01:00) Windhoek", 60, "Namibia Daylight Time", "Namibia Standard Time"));
  71.         tz.Add(new TimeZoneInformation("Jordan Standard Time", "(UTC+02:00) Amman", 120, "Jordan Daylight Time", "Jordan Standard Time"));
  72.         tz.Add(new TimeZoneInformation("GTB Standard Time", "(UTC+02:00) Athens, Bucharest, Istanbul", 120, "GTB Daylight Time", "GTB Standard Time"));
  73.         tz.Add(new TimeZoneInformation("Middle East Standard Time", "(UTC+02:00) Beirut", 120, "Middle East Daylight Time", "Middle East Standard Time"));
  74.         tz.Add(new TimeZoneInformation("Egypt Standard Time", "(UTC+02:00) Cairo", 120, "Egypt Daylight Time", "Egypt Standard Time"));
  75.         tz.Add(new TimeZoneInformation("Syria Standard Time", "(UTC+02:00) Damascus", 120, "Syria Daylight Time", "Syria Standard Time"));
  76.         tz.Add(new TimeZoneInformation("South Africa Standard Time", "(UTC+02:00) Harare, Pretoria", 120, "South Africa Daylight Time", "South Africa Standard Time"));
  77.         tz.Add(new TimeZoneInformation("FLE Standard Time", "(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius", 120, "FLE Daylight Time", "FLE Standard Time"));
  78.         tz.Add(new TimeZoneInformation("Israel Standard Time", "(UTC+02:00) Jerusalem", 120, "Jerusalem Daylight Time", "Jerusalem Standard Time"));
  79.         tz.Add(new TimeZoneInformation("E. Europe Standard Time", "(UTC+02:00) Minsk", 120, "E. Europe Daylight Time", "E. Europe Standard Time"));
  80.         tz.Add(new TimeZoneInformation("Arabic Standard Time", "(UTC+03:00) Baghdad", 180, "Arabic Daylight Time", "Arabic Standard Time"));
  81.         tz.Add(new TimeZoneInformation("Arab Standard Time", "(UTC+03:00) Kuwait, Riyadh", 180, "Arab Daylight Time", "Arab Standard Time"));
  82.         tz.Add(new TimeZoneInformation("Russian Standard Time", "(UTC+03:00) Moscow, St. Petersburg, Volgograd", 180, "Russian Daylight Time", "Russian Standard Time"));
  83.         tz.Add(new TimeZoneInformation("E. Africa Standard Time", "(UTC+03:00) Nairobi", 180, "E. Africa Daylight Time", "E. Africa Standard Time"));
  84.         tz.Add(new TimeZoneInformation("Iran Standard Time", "(UTC+03:30) Tehran", 210, "Iran Daylight Time", "Iran Standard Time"));
  85.         tz.Add(new TimeZoneInformation("Arabian Standard Time", "(UTC+04:00) Abu Dhabi, Muscat", 240, "Arabian Daylight Time", "Arabian Standard Time"));
  86.         tz.Add(new TimeZoneInformation("Azerbaijan Standard Time", "(UTC+04:00) Baku", 240, "Azerbaijan Daylight Time", "Azerbaijan Standard Time"));
  87.         tz.Add(new TimeZoneInformation("Mauritius Standard Time", "(UTC+04:00) Port Louis", 240, "Mauritius Daylight Time", "Mauritius Standard Time"));
  88.         tz.Add(new TimeZoneInformation("Georgian Standard Time", "(UTC+04:00) Tbilisi", 240, "Georgian Daylight Time", "Georgian Standard Time"));
  89.         tz.Add(new TimeZoneInformation("Caucasus Standard Time", "(UTC+04:00) Yerevan", 240, "Caucasus Daylight Time", "Caucasus Standard Time"));
  90.         tz.Add(new TimeZoneInformation("Afghanistan Standard Time", "(UTC+04:30) Kabul", 270, "Afghanistan Daylight Time", "Afghanistan Standard Time"));
  91.         tz.Add(new TimeZoneInformation("Ekaterinburg Standard Time", "(UTC+05:00) Ekaterinburg", 300, "Ekaterinburg Daylight Time", "Ekaterinburg Standard Time"));
  92.         tz.Add(new TimeZoneInformation("Pakistan Standard Time", "(UTC+05:00) Islamabad, Karachi", 300, "Pakistan Daylight Time", "Pakistan Standard Time"));
  93.         tz.Add(new TimeZoneInformation("West Asia Standard Time", "(UTC+05:00) Tashkent", 300, "West Asia Daylight Time", "West Asia Standard Time"));
  94.         tz.Add(new TimeZoneInformation("India Standard Time", "(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi", 330, "India Daylight Time", "India Standard Time"));
  95.         tz.Add(new TimeZoneInformation("Sri Lanka Standard Time", "(UTC+05:30) Sri Jayawardenepura", 330, "Sri Lanka Daylight Time", "Sri Lanka Standard Time"));
  96.         tz.Add(new TimeZoneInformation("Nepal Standard Time", "(UTC+05:45) Kathmandu", 345, "Nepal Daylight Time", "Nepal Standard Time"));
  97.         tz.Add(new TimeZoneInformation("Central Asia Standard Time", "(UTC+06:00) Astana", 360, "Central Asia Daylight Time", "Central Asia Standard Time"));
  98.         tz.Add(new TimeZoneInformation("Bangladesh Standard Time", "(UTC+06:00) Dhaka", 360, "Bangladesh Daylight Time", "Bangladesh Standard Time"));
  99.         tz.Add(new TimeZoneInformation("N. Central Asia Standard Time", "(UTC+06:00) Novosibirsk", 360, "N. Central Asia Daylight Time", "N. Central Asia Standard Time"));
  100.         tz.Add(new TimeZoneInformation("Myanmar Standard Time", "(UTC+06:30) Yangon (Rangoon)", 390, "Myanmar Daylight Time", "Myanmar Standard Time"));
  101.         tz.Add(new TimeZoneInformation("SE Asia Standard Time", "(UTC+07:00) Bangkok, Hanoi, Jakarta", 420, "SE Asia Daylight Time", "SE Asia Standard Time"));
  102.         tz.Add(new TimeZoneInformation("North Asia Standard Time", "(UTC+07:00) Krasnoyarsk", 420, "North Asia Daylight Time", "North Asia Standard Time"));
  103.         tz.Add(new TimeZoneInformation("China Standard Time", "(UTC+08:00) Beijing, Chongqing, Hong Kong, Urumqi", 480, "China Daylight Time", "China Standard Time"));
  104.         tz.Add(new TimeZoneInformation("North Asia East Standard Time", "(UTC+08:00) Irkutsk", 480, "North Asia East Daylight Time", "North Asia East Standard Time"));
  105.         tz.Add(new TimeZoneInformation("Singapore Standard Time", "(UTC+08:00) Kuala Lumpur, Singapore", 480, "Malay Peninsula Daylight Time", "Malay Peninsula Standard Time"));
  106.         tz.Add(new TimeZoneInformation("W. Australia Standard Time", "(UTC+08:00) Perth", 480, "W. Australia Daylight Time", "W. Australia Standard Time"));
  107.         tz.Add(new TimeZoneInformation("Taipei Standard Time", "(UTC+08:00) Taipei", 480, "Taipei Daylight Time", "Taipei Standard Time"));
  108.         tz.Add(new TimeZoneInformation("Ulaanbaatar Standard Time", "(UTC+08:00) Ulaanbaatar", 480, "Ulaanbaatar Daylight Time", "Ulaanbaatar Standard Time"));
  109.         tz.Add(new TimeZoneInformation("Tokyo Standard Time", "(UTC+09:00) Osaka, Sapporo, Tokyo", 540, "Tokyo Daylight Time", "Tokyo Standard Time"));
  110.         tz.Add(new TimeZoneInformation("Korea Standard Time", "(UTC+09:00) Seoul", 540, "Korea Daylight Time", "Korea Standard Time"));
  111.         tz.Add(new TimeZoneInformation("Yakutsk Standard Time", "(UTC+09:00) Yakutsk", 540, "Yakutsk Daylight Time", "Yakutsk Standard Time"));
  112.         tz.Add(new TimeZoneInformation("Cen. Australia Standard Time", "(UTC+09:30) Adelaide", 570, "Cen. Australia Daylight Time", "Cen. Australia Standard Time"));
  113.         tz.Add(new TimeZoneInformation("AUS Central Standard Time", "(UTC+09:30) Darwin", 570, "AUS Central Daylight Time", "AUS Central Standard Time"));
  114.         tz.Add(new TimeZoneInformation("E. Australia Standard Time", "(UTC+10:00) Brisbane", 600, "E. Australia Daylight Time", "E. Australia Standard Time"));
  115.         tz.Add(new TimeZoneInformation("AUS Eastern Standard Time", "(UTC+10:00) Canberra, Melbourne, Sydney", 600, "AUS Eastern Daylight Time", "AUS Eastern Standard Time"));
  116.         tz.Add(new TimeZoneInformation("West Pacific Standard Time", "(UTC+10:00) Guam, Port Moresby", 600, "West Pacific Daylight Time", "West Pacific Standard Time"));
  117.         tz.Add(new TimeZoneInformation("Tasmania Standard Time", "(UTC+10:00) Hobart", 600, "Tasmania Daylight Time", "Tasmania Standard Time"));
  118.         tz.Add(new TimeZoneInformation("Vladivostok Standard Time", "(UTC+10:00) Vladivostok", 600, "Vladivostok Daylight Time", "Vladivostok Standard Time"));
  119.         tz.Add(new TimeZoneInformation("Magadan Standard Time", "(UTC+11:00) Magadan", 660, "Magadan Daylight Time", "Magadan Standard Time"));
  120.         tz.Add(new TimeZoneInformation("Central Pacific Standard Time", "(UTC+11:00) Solomon Is., New Caledonia", 660, "Central Pacific Daylight Time", "Central Pacific Standard Time"));
  121.         tz.Add(new TimeZoneInformation("New Zealand Standard Time", "(UTC+12:00) Auckland, Wellington", 720, "New Zealand Daylight Time", "New Zealand Standard Time"));
  122.         tz.Add(new TimeZoneInformation("UTC+12", "(UTC+12:00) Coordinated Universal Time+12", 720, "UTC+12", "UTC+12"));
  123.         tz.Add(new TimeZoneInformation("Fiji Standard Time", "(UTC+12:00) Fiji", 720, "Fiji Daylight Time", "Fiji Standard Time"));
  124.         tz.Add(new TimeZoneInformation("Kamchatka Standard Time", "(UTC+12:00) Petropavlovsk-Kamchatsky - Old", 720, "Kamchatka Daylight Time", "Kamchatka Standard Time"));
  125.         tz.Add(new TimeZoneInformation("Tonga Standard Time", "(UTC+13:00) Nuku'alofa", 780, "Tonga Daylight Time", "Tonga Standard Time"));
  126.  
  127.  
  128.         return tz;
  129.     }