S
Scott
Hi All,
I have a few questions about timezones, I am currently writting an
application where I am required to manage times in different time
zones. Unfortunaly its not sufficent for me to store UTC time, so I am
storing UTC time and an index to the time zone
eg/
string[] zoneNames = key.GetSubKeyNames();
int index = 0;
foreach (string zoneName in zoneNames)
{
using (RegistryKey subKey =
key.OpenSubKey(zoneName))
{
TimeZoneInformation tzi = new
TimeZoneInformation();
tzi.m_name = zoneName;
tzi.m_displayName =
(string)subKey.GetValue("Display");
tzi.m_standardName =
(string)subKey.GetValue("Std");
tzi.m_daylightName =
(string)subKey.GetValue("Dlt");
tzi.m_index = index;
index++;
tzi.InitTzi((byte[])subKey.GetValue("Tzi"));
int bias = tzi.Bias;
while (zones.ContainsKey(bias))
{
bias++;
}
zones.Add(bias,tzi);
}
}
Now, when I upload this from my local computer to a server, the
timezone seem to load in a different order from the registery.
I feel the way I am indexing the timezones could change with a
timezone patch, is this the case? How is the best way to identify a
timezone?
Regards
Scott
I have a few questions about timezones, I am currently writting an
application where I am required to manage times in different time
zones. Unfortunaly its not sufficent for me to store UTC time, so I am
storing UTC time and an index to the time zone
eg/
string[] zoneNames = key.GetSubKeyNames();
int index = 0;
foreach (string zoneName in zoneNames)
{
using (RegistryKey subKey =
key.OpenSubKey(zoneName))
{
TimeZoneInformation tzi = new
TimeZoneInformation();
tzi.m_name = zoneName;
tzi.m_displayName =
(string)subKey.GetValue("Display");
tzi.m_standardName =
(string)subKey.GetValue("Std");
tzi.m_daylightName =
(string)subKey.GetValue("Dlt");
tzi.m_index = index;
index++;
tzi.InitTzi((byte[])subKey.GetValue("Tzi"));
int bias = tzi.Bias;
while (zones.ContainsKey(bias))
{
bias++;
}
zones.Add(bias,tzi);
}
}
Now, when I upload this from my local computer to a server, the
timezone seem to load in a different order from the registery.
I feel the way I am indexing the timezones could change with a
timezone patch, is this the case? How is the best way to identify a
timezone?
Regards
Scott