Click here to Skip to main content
11,709,536 members (48,501 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET Windows DateTime , +
I was given the TzID (Olson tzid format Exp: "Europe/Copenhagen"). After that, i tried to do the timezone conversion for certain DateTime from that timezone (different with server local time zone) to UTC by using c# TimeZonInfo class.

I was wondering why window's timezone id only have about 100 whereas the timezone id for Olson tz database have about 405 tz id. Lets say for time zone "Europe/Copenhagen", i have no idea how to use the FindSystemTimeZonebyID to get the time zone info for this time zone (It was listed in metazones in the Olson ID to windows ID convertion table). Anyone experienced in this? Please help me.[^][^]
Posted 27-Jan-11 15:21pm
Edited 27-Jan-11 23:21pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

You can see this links
darrell987 at 28-Jan-11 8:34am
Thanks for the reply. I know how to use FindSystemTimeZonebyID to convert local time to UTC and also converting DateTime from one time zone to another. I was just unclear of how to retrieve the time zone information for certain timezone like "Europe/Copenhagen" who have the corresponding Windows Timezone ID of "Europe_Central" which cannot be found in the "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\Time Zones". Thanks again for your help.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

At the end, i gave up with the class "timezoneinfo" method and just using the Olson database. There's a nice tool to access and calling the Olson database in .Net.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 Sergey Alexandrovich Kryukov 525
1 OriginalGriff 250
2 Peter Leow 219
3 Maciej Los 185
4 Mika Wendelius 160
0 OriginalGriff 9,428
1 Sergey Alexandrovich Kryukov 9,037
2 CPallini 5,189
3 Maciej Los 4,991
4 Mika Wendelius 3,856

Advertise | Privacy | Mobile
Web04 | 2.8.150819.1 | Last Updated 9 Feb 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100