Click or drag to resize

TimeZone Structure

Verizon Connect Logo
Print this page
Learn more about Verizon Connect GeoBase.
Get information about the latest release
A TimeZone may be used to convert from UTC to local (street) time. You should not construct a TimeZone object manually. Instead, use the ReverseGeoCodeFull(LatLon) method, and retrieve a TimeZone object from the TimeZone property of the method's return value.

Namespace:  Telogis.GeoBase
Assembly:  geobase.net (in geobase.net.dll) Version: 4.86.0.0
Syntax
public struct TimeZone

The TimeZone type exposes the following members.

Properties
  NameDescription
Public propertyDSTEndDayOfMonth
Gets the day of the month in which daylight savings ends for this timezone.
Public propertyDSTEndDayOfWeek
Returns the day of the week that daylight savings ends.
Public propertyDSTEndDayType
Gets the way in which the end of daylight savings is implemented for this timezone.
Public propertyDSTEndMonth
Gets the month in which daylight savings ends for this timezone.
Public propertyDSTEndTimeOfDay
Gets the time of day at which daylight savings ends for this timezone.
Public propertyDSTEndWeekOfMonth
Gets the week of the month in which daylight savings ends for this timezone.
Public propertyDSTStartDayOfMonth
Gets the day of the month in which daylight savings starts for this timezone.
Public propertyDSTStartDayOfWeek
Returns the day of the week that daylight savings begins.
Public propertyDSTStartDayType
Gets the way in which the start of daylight savings is implemented for this timezone.
Public propertyDSTStartMonth
Gets the month in which daylight savings starts for this timezone.
Public propertyDSTStartTimeOfDay
Gets the time of day at which daylight savings starts for this timezone.
Public propertyDSTStartWeekOfMonth
Gets the week of the month in which daylight savings starts for this timezone.
Public propertyGMTOffset
Returns the difference between this TimeZone and GMT, in hours.
Public propertyHasDST
Returns true if this TimeZone has daylight savings.
Top
Methods
  NameDescription
Public methodConvertTime
Returns the time of this timezone for the given time; the given time can be UTC or Local.
Public methodEquals
Indicates whether this instance and a specified object are equal.
(Inherited from ValueType.)
Public methodGetHashCode
Returns the hash code for this instance.
(Inherited from ValueType.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Public methodToString
Returns the fully qualified type name of this instance.
(Inherited from ValueType.)
Top
Remarks
TimeZone objects are structs so cannot take a null value. Typically, GeoBase will allow access to TimeZone objects through nullable properties. Be sure to test HasValue (as in the code example below) to determine if timezone information is available for the given street.
Examples
C#
   // 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

See Also