FoodCandy!

TimeZoneInformation Class Reference

Information about a time zone. More...

List of all members.


Public Member Functions

override string ToString ()
DateTime FromUniversalTime (DateTime utc)
 Convert a time interpreted as UTC to a time in this time zone.
DateTime ToUniversalTime (DateTime local)
 Convert a time interpreted as a local time in this zone to the equivalent UTC. Note that there may be different possible interpretations at the daylight time boundaries.

Static Public Member Functions

static int CompareByTzOffset (TimeZoneInformation left, TimeZoneInformation right)
static TimeZoneInformation FromIndex (int index)
 Get a TimeZoneInformation for a supplied index.
static TimeZoneInformation[] EnumZones ()
 Enumerate the available time zones.
static DateTime FromUniversalTime (int index, DateTime utc)
 Convert a time from UTC to the time zone with the supplied index.
static DateTime ToUniversalTime (int index, DateTime local)
 Convert a time from the time zone with the supplied index to UTC.

Properties

static TimeZoneInformation CurrentTimeZone
 Get the currently selected time zone.
string Name = SOFTWARE\Microsoft\Windows NT\CurrentVersion\Time Zones"
 The zone's name.
string DisplayName
 The zone's display name, e.g. '(GMT) Greenwich Mean Time : Dublin, Edinburgh, Lisbon, London'.
int Index
 The zone's index. No obvious pattern.
string StandardName
 The zone's name during 'standard' time (not daylight savings).
string DaylightName
 The zone's name during daylight savings time.
int Bias
 The offset from UTC. Local = UTC + Bias.
int CurrentUtcBiasHours
 The offset from UTC. Local = UTC + Bias.
int StandardBias
 The offset from UTC during standard time.
int DaylightBias
 The offset from UTC during daylight time.

Classes

struct  NativeMethods
 A container for P/Invoke declarations.
struct  SYSTEMTIME
 The standard Windows SYSTEMTIME structure.
struct  TIME_ZONE_INFORMATION
 The standard Win32 TIME_ZONE_INFORMATION structure. Thanks to www.pinvoke.net.
struct  TZI
 The layout of the Tzi value in the registry.

Detailed Description

Information about a time zone.


Member Function Documentation

static TimeZoneInformation [] EnumZones  )  [static]
 

Enumerate the available time zones.

Returns:
The list of known time zones

static TimeZoneInformation FromIndex int  index  )  [static]
 

Get a TimeZoneInformation for a supplied index.

Parameters:
index The time zone to find.
Returns:
The corresponding TimeZoneInformation.
Exceptions:
System.ArgumentOutOfRangeException Thrown if the index is not found.

static DateTime FromUniversalTime int  index,
DateTime  utc
[static]
 

Convert a time from UTC to the time zone with the supplied index.

Parameters:
index The time zone index.
utc The time to convert.
Returns:
The converted time.
Exceptions:
ArgumentOutOfRangeException Thrown if the index is not found.

DateTime FromUniversalTime DateTime  utc  ) 
 

Convert a time interpreted as UTC to a time in this time zone.

Parameters:
utc The UTC time to convert.
Returns:
The corresponding local time in this zone.

static DateTime ToUniversalTime int  index,
DateTime  local
[static]
 

Convert a time from the time zone with the supplied index to UTC.

Parameters:
index The time zone index.
utc The time to convert.
Returns:
The converted time.
Exceptions:
ArgumentOutOfRangeException Thrown if the index is not found.
NotSupportedException Thrown if the method failed due to missing platform support.

DateTime ToUniversalTime DateTime  local  ) 
 

Convert a time interpreted as a local time in this zone to the equivalent UTC. Note that there may be different possible interpretations at the daylight time boundaries.

Parameters:
local The local time to convert.
Returns:
The corresponding UTC.
Exceptions:
NotSupportedException Thrown if the method failed due to missing platform support.

The documentation for this class was generated from the following file:
  • TimeZoneInformation.cs
© FoodCandy, 2006-2007, All Rights Reserved | FoodCandy | Sun Oct 7 10:48:52 2007 | Doxygen 1.4.6-NO