Click here to Skip to main content
Rate this: bad
good
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.
 
http://unicode.org/repos/cldr-tmp/trunk/diff/supplemental/zone_tzid.html[^]
http://en.wikipedia.org/wiki/List_of_tz_database_time_zones[^]
Posted 27-Jan-11 16:21pm
Edited 28-Jan-11 0:21am
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

You can see this links
Click
Click
Click
  Permalink  
Comments
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
good
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.
 
http://www.codeproject.com/KB/locale/zoneinfo_dotnet_api.aspx
  Permalink  

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

  Print Answers RSS
0 OriginalGriff 587
1 Sergey Alexandrovich Kryukov 479
2 Maciej Los 305
3 Mathew Soji 195
4 Richard MacCutchan 145
0 OriginalGriff 7,356
1 Sergey Alexandrovich Kryukov 6,712
2 DamithSL 5,461
3 Manas Bhardwaj 4,916
4 Maciej Los 4,475


Advertise | Privacy | Mobile
Web01 | 2.8.1411023.1 | Last Updated 9 Feb 2011
Copyright © CodeProject, 1999-2014
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