|
|
To list the different TimeZones on your machine, use the TimeZoneInfo class. Here’s a sample:
C#
static class Program
{
public static void Main(string[] args)
{
var tzone = TimeZoneInfo.GetSystemTimeZones();
foreach (TimeZoneInfo tzi in tzone)
{
Console.WriteLine("{0}", tzi.DisplayName);
}
Console.ReadLine();
}
}
VB.NET
Class Program
Private Sub New()
End Sub
Public Shared Sub Main(ByVal args() As String)
Dim tzone = TimeZoneInfo.GetSystemTimeZones()
For Each tzi As TimeZoneInfo In tzone
Console.WriteLine("{0}", tzi.DisplayName)
Next tzi
Console.ReadLine()
End Sub
End Class
OUTPUT
'Like' us on our FaceBook page if you find this blog useful. Thanks!
Did you like this post?
|
|
|
||
|
|
|
|
Save on Delicious |
|
|
subscribe via rss |
|
subscribe via e-mail |
|
|
print this post |
|
follow me on twitter |




comments
1 Response to "List all the TimeZones available on your machine using C# or VB.NET"nice..
Post a Comment