Time Zones on the Computer

S

Scott

Hi All,

Currently I am writting an application around safe travel, as part of
the system I need to store timezone information and also specific time
zone dates.

So, I use

TIME_ZONE_INFORMATION tziNative;
TimeZoneInformation[] zones = EnumZones();

NativeMethods.GetTimeZoneInformation(out tziNative);

// Getting the identity is tricky; the best we can do
// is a match on the properties.

for (int idx = 0; idx < zones.Length; ++idx)
{
if (zones[idx].m_tzi.bias == tziNative.Bias &&
zones[idx].m_tzi.daylightBias ==
tziNative.DaylightBias &&
zones[idx].m_tzi.standardBias ==
tziNative.StandardBias &&
zones[idx].m_standardName ==
tziNative.StandardName &&
zones[idx].m_daylightName ==
tziNative.DaylightName)
{
return zones[idx];
}
}

To get the time zone, and in the database I am storing the index to
the time zones.
Are these timezones ever added to, or removed?

Whats the best way to reference a timezone ?

Thanks
Scott
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top