Tuesday, January 11, 2011

SharePoint SPRegionalSettings.GlobalTimeZones ID List

I couldn't find a reference for this anywhere, so decided to create my own.

IDDescription
2(UTC) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London
3(UTC+01:00) Brussels, Copenhagen, Madrid, Paris
4(UTC+01:00) Amsterdam, Berlin, Bern, Rome, Stockholm, Vienna
5(UTC+02:00) Athens, Bucharest, Istanbul
6(UTC+01:00) Belgrade, Bratislava, Budapest, Ljubljana, Prague
7(UTC+02:00) Minsk
8(UTC-03:00) Brasilia
9(UTC-04:00) Atlantic Time (Canada)
10(UTC-05:00) Eastern Time (US and Canada)
11(UTC-06:00) Central Time (US and Canada)
12(UTC-07:00) Mountain Time (US and Canada)
13(UTC-08:00) Pacific Time (US and Canada)
14(UTC-09:00) Alaska
15(UTC-10:00) Hawaii
16(UTC-11:00) Midway Island, Samoa
17(UTC+12:00) Auckland, Wellington
18(UTC+10:00) Brisbane
19(UTC+09:30) Adelaide
20(UTC+09:00) Osaka, Sapporo, Tokyo
21(UTC+08:00) Kuala Lumpur, Singapore
22(UTC+07:00) Bangkok, Hanoi, Jakarta
23(UTC+05:30) Chennai, Kolkata, Mumbai, New Delhi
24(UTC+04:00) Abu Dhabi, Muscat
25(UTC+03:30) Tehran
26(UTC+03:00) Baghdad
27(UTC+02:00) Jerusalem
28(UTC-03:30) Newfoundland and Labrador
29(UTC-01:00) Azores
30(UTC-02:00) Mid-Atlantic
31(UTC) Monrovia, Reykjavik
32(UTC-03:00) Cayenne
33(UTC-04:00) Georgetown, La Paz, San Juan
34(UTC-05:00) Indiana (East)
35(UTC-05:00) Bogota, Lima, Quito
36(UTC-06:00) Saskatchewan
37(UTC-06:00) Guadalajara, Mexico City, Monterrey
38(UTC-07:00) Arizona
39(UTC-12:00) International Date Line West
40(UTC+12:00) Fiji Is., Marshall Is.
41(UTC+11:00) Magadan, Solomon Is., New Caledonia
42(UTC+10:00) Hobart
43(UTC+10:00) Guam, Port Moresby
44(UTC+09:30) Darwin
45(UTC+08:00) Beijing, Chongqing, Hong Kong S.A.R., Urumqi
46(UTC+06:00) Novosibirsk
47(UTC+05:00) Tashkent
48(UTC+04:30) Kabul
49(UTC+02:00) Cairo
50(UTC+02:00) Harare, Pretoria
51(UTC+03:00) Moscow, St. Petersburg, Volgograd
53(UTC-01:00) Cape Verde Is.
54(UTC+04:00) Baku
55(UTC-06:00) Central America
56(UTC+03:00) Nairobi
57(UTC+01:00) Sarajevo, Skopje, Warsaw, Zagreb
58(UTC+05:00) Ekaterinburg
59(UTC+02:00) Helsinki, Kyiv, Riga, Sofia, Tallinn, Vilnius
60(UTC-03:00) Greenland
61(UTC+06:30) Yangon (Rangoon)
62(UTC+05:45) Kathmandu
63(UTC+08:00) Irkutsk
64(UTC+07:00) Krasnoyarsk
65(UTC-04:00) Santiago
66(UTC+05:30) Sri Jayawardenepura
67(UTC+13:00) Nuku'alofa
68(UTC+10:00) Vladivostok
69(UTC+01:00) West Central Africa
70(UTC+09:00) Yakutsk
71(UTC+06:00) Astana, Dhaka
72(UTC+09:00) Seoul
73(UTC+08:00) Perth
74(UTC+03:00) Kuwait, Riyadh
75(UTC+08:00) Taipei
76(UTC+10:00) Canberra, Melbourne, Sydney
77(UTC-07:00) Chihuahua, La Paz, Mazatlan
78(UTC-08:00) Tijuana, Baja California
79(UTC+02:00) Amman
80(UTC+02:00) Beirut
81(UTC-04:00) Manaus
82(UTC+04:00) Tbilisi
83(UTC+02:00) Windhoek
84(UTC+04:00) Yerevan
85(UTC-03:00) Buenos Aires
86(UTC) Casablanca
87(UTC+05:00) Islamabad, Karachi
88(UTC-04:30) Caracas
89(UTC+04:00) Port Louis
90(UTC-03:00) Montevideo
91(UTC-04:00) Asuncion
92(UTC+12:00) Petropavlovsk-Kamchatsky
93(UTC) Coordinated Universal Time
94(UTC+08:00) Ulaanbaatar

Source Code
using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.SharePoint;

namespace ConsoleApplication1
{
class Program
{
static void Main(string[] args)
{
SPTimeZoneCollection timeZones = SPRegionalSettings.GlobalTimeZones;
Dictionary timeZoneList = new Dictionary();
Console.WriteLine("\r\nSharePoint Global Time Zones");
foreach (SPTimeZone timeZone in timeZones)
{
timeZoneList.Add(timeZone.ID, timeZone.Description);
}
foreach (KeyValuePair time in timeZoneList.OrderBy(x => x.Key))
{
Console.WriteLine(time.Key.ToString() + "\t" + time.Value);
}
Console.WriteLine("\r\nHTML Format");
foreach (KeyValuePair time in timeZoneList.OrderBy(x => x.Key))
{
Console.WriteLine("" + time.Key.ToString() + "" + time.Value + "");
}
Console.Read();
}
}
}

References

No comments:

Post a Comment