TimeZone Structure |
Namespace: Telogis.GeoBase
The TimeZone type exposes the following members.
Name | Description | |
---|---|---|
DSTEndDayOfMonth |
Gets the day of the month in which daylight savings ends for this timezone.
| |
DSTEndDayOfWeek |
Returns the day of the week that daylight savings ends.
| |
DSTEndDayType |
Gets the way in which the end of daylight savings is implemented for this
timezone.
| |
DSTEndMonth |
Gets the month in which daylight savings ends for this timezone.
| |
DSTEndTimeOfDay |
Gets the time of day at which daylight savings ends for this timezone.
| |
DSTEndWeekOfMonth |
Gets the week of the month in which daylight savings ends for this timezone.
| |
DSTStartDayOfMonth |
Gets the day of the month in which daylight savings starts for this timezone.
| |
DSTStartDayOfWeek |
Returns the day of the week that daylight savings begins.
| |
DSTStartDayType |
Gets the way in which the start of daylight savings is implemented for this
timezone.
| |
DSTStartMonth |
Gets the month in which daylight savings starts for this timezone.
| |
DSTStartTimeOfDay |
Gets the time of day at which daylight savings starts for this timezone.
| |
DSTStartWeekOfMonth |
Gets the week of the month in which daylight savings starts for this timezone.
| |
GMTOffset |
Returns the difference between this TimeZone and GMT, in hours.
| |
HasDST |
Returns true if this TimeZone has daylight savings.
|
Name | Description | |
---|---|---|
ConvertTime |
Returns the time of this timezone for the given time; the given time can be UTC or Local.
| |
Equals | Indicates whether this instance and a specified object are equal. (Inherited from ValueType.) | |
GetHashCode | Returns the hash code for this instance. (Inherited from ValueType.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
ToString | Returns the fully qualified type name of this instance. (Inherited from ValueType.) |
// this is your current (local) time DateTime localTime = DateTime.Now; Console.WriteLine("Local time is {0}", localTime.ToString()); // convert the current local time to UTC DateTime utcTime = localTime.ToUniversalTime(); Console.WriteLine("UTC is {0}", utcTime.ToString()); GeoCodeFull gf = GeoCoder.ReverseGeoCodeFull(new LatLon(33.581650, -117.727285)); if (gf.TimeZone.HasValue) { Telogis.GeoBase.TimeZone tz = gf.TimeZone.Value; // use the timezone to convert the UTC time to street time DateTime streetTime = tz.ConvertTime(utcTime); Console.WriteLine("Street time is {0}", streetTime.ToString()); } else { // there is no timezone information for this street Console.WriteLine("No timezone information is available for that street"); }
Sample output:
Local time is 7/22/2010 1:51:30 PM UTC is 7/22/2010 1:51:30 AM Street time is 7/21/2010 6:51:30 PM |