TZDB for Delphi Documentation by pasdoc 2018-03-04

Class TBundledTimeZone

Unit

Declaration

type TBundledTimeZone = class(TObject)

Description

<summary>A timezone class implementation that retreives its data from the bundled database.</summary> <remarks>This class inherits the standard <c>TTimeZone</c> class in Delphi XE.</remarks>

Hierarchy

  • TObject
  • TBundledTimeZone

Overview

Methods

Public constructor Create(const ATimeZoneID: string);
Public destructor Destroy; override;
Public function AmbiguousTimeEnd(const aYear: word): TDateTime;
Public function AmbiguousTimeStart(const aYear: word): TDateTime;
Public function DaylightTimeEnd(const aYear: word): TDateTime;
Public function DaylightTimeStart(const aYear: word): TDateTime;
Public function GetAbbreviation(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): string;
Public function GetDisplayName(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): string;
Public function GetLocalTimeType(const ADateTime: TDateTime): TLocalTimeType;
Public class function GetTimeZone(const ATimeZoneID: string): TBundledTimeZone;
Public function GetUtcOffset(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): Int64;
Public function InvalidTimeEnd(const aYear: word): TDateTime;
Public function InvalidTimeStart(const aYear: word): TDateTime;
Public function IsAmbiguousTime(const ADateTime: TDateTime): Boolean;
Public function IsDaylightTime(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): Boolean;
Public function IsInvalidTime(const ADateTime: TDateTime): Boolean;
Public function IsStandardTime(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): Boolean;
Public class function KnownTimeZones(const AIncludeAliases: Boolean = False): TStringDynArray;
Public function OperatesDayligtTime(const aYear: word): boolean;
Public function StandardTimeEnd(const aYear: word): TDateTime;
Public function StardardTimeStart(const aYear: word): TDateTime;
Public function ToISO8601Str(const ADateTime: TDateTime): String;
Public function ToLocalTime(const ADateTime: TDateTime): TDateTime;
Public function ToUniversalTime(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): TDateTime;
Protected function DoGetID: string;

Properties

Public property Abbreviation: string read GetCurrentAbbreviation;
Public property DisplayName: string read GetCurrentDisplayName;
Public property ID: string read DoGetID;
Public property UtcOffset: Int64 read GetCurrentUtcOffset;

Description

Methods

Public constructor Create(const ATimeZoneID: string);

<summary>Creates a new instance of this timezone class.</summary> <param name="ATimeZoneID">The ID of the timezone to use (ex. "Europe/Bucharest").</param> <exception cref="TZDB|ETimeZoneInvalid">The specified ID cannot be found in the bundled database.</exception>

Public destructor Destroy; override;

<summary>Destroys the current instance.</summary>

Public function AmbiguousTimeEnd(const aYear: word): TDateTime;

<summary>Get the end point of Ambiguous time</summary> <param name="aYear">The Year to get data for</param> <returns>The end time of Ambiguous time in timezone local time</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function AmbiguousTimeStart(const aYear: word): TDateTime;

<summary>Get the start point of Ambiguous time</summary> <param name="aYear">The Year to get data for</param> <returns>The start time of Ambiguous time in timezone local time</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function DaylightTimeEnd(const aYear: word): TDateTime;

<summary>Get the end point of daylight time</summary> <param name="aYear">The Year to get data for</param> <returns>The end time of daylight time in timezone local time</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function DaylightTimeStart(const aYear: word): TDateTime;

<summary>Get the start point of daylight time</summary> <param name="aYear">The Year to get data for</param> <returns>The start time of daylight time in timezone local time</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function GetAbbreviation(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): string;

<summary>Generates an abbreviation string for the given local time.</summary> <param name="ADateTime">The local time.</param> <param name="AForceDaylight">Specify a <c>True</c> value if ambiguous periods should be treated as DST.</param> <returns>A string containing the abbreviation.</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function GetDisplayName(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): string;

<summary>Generates a diplay string for the given local time.</summary> <param name="ADateTime">The local time.</param> <param name="AForceDaylight">Specify a <c>True</c> value if ambiguous periods should be treated as DST.</param> <returns>A string containing the display name.</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function GetLocalTimeType(const ADateTime: TDateTime): TLocalTimeType;

<summary>Returns the type of the local time.</summary> <param name="ADateTime">The local time.</param> <returns>An enumeration value specifying the type of the local time.</returns>

Public class function GetTimeZone(const ATimeZoneID: string): TBundledTimeZone;

<summary>Returns an instance of this time zone class.</summary> <param name="ATimeZoneID">The ID of the timezone to use (ex. "Europe/Bucharest").</param> <exception cref="TZDB|ETimeZoneInvalid">The specified ID cannot be found in the bundled database.</exception>

Public function GetUtcOffset(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): Int64;

<summary>Returns the UTC offset of the given local time.</summary> <param name="ADateTime">The local time.</param> <param name="AForceDaylight">Specify a <c>True</c> value if ambiguous periods should be treated as DST.</param> <returns>The UTC offset of the given local time. Subtract this value from the passed local time to obtain an UTC time.</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function InvalidTimeEnd(const aYear: word): TDateTime;

<summary>Get the end point of Invalid time</summary> <param name="aYear">The Year to get data for</param> <returns>The end time of Invalid time in timezone local time</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function InvalidTimeStart(const aYear: word): TDateTime;

<summary>Get the start point of Invalid time</summary> <param name="aYear">The Year to get data for</param> <returns>The start time of Invalid time in timezone local time</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function IsAmbiguousTime(const ADateTime: TDateTime): Boolean;

<summary>Checks whether the specified local time is ambiguous.</summary> <param name="ADateTime">The local time.</param> <returns><c>True</c> if the local time is ambiguous; <c>False</c> otherwise.</returns>

Public function IsDaylightTime(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): Boolean;

<summary>Checks whether the specified local time is daylight.</summary> <param name="ADateTime">The local time.</param> <param name="AForceDaylight">Specify a <c>True</c> value if ambiguous periods should be treated as DST.</param> <returns><c>True</c> if the local time is ambiguous; <c>False</c> otherwise.</returns>

Public function IsInvalidTime(const ADateTime: TDateTime): Boolean;

<summary>Checks whether the specified local time is invalid.</summary> <param name="ADateTime">The local time.</param> <returns><c>True</c> if the local time is invalid; <c>False</c> otherwise.</returns>

Public function IsStandardTime(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): Boolean;

<summary>Checks whether the specified local time is standard.</summary> <param name="ADateTime">The local time.</param> <param name="AForceDaylight">Specify a <c>True</c> value if ambiguous periods should be treated as DST.</param> <returns><c>True</c> if the local time is standard; <c>False</c> otherwise.</returns>

Public class function KnownTimeZones(const AIncludeAliases: Boolean = False): TStringDynArray;

<summary>Returns a list of known time zones.</summary> <param name="AIncludeAliases">Pass <c>True</c> to include time zone aliases into the list.</param> <returns>An array of strings representing the IDs of the known time zones.</returns>

Public function OperatesDayligtTime(const aYear: word): boolean;

<summary>Determin if the timezone has daylight time</summary> <param name="aYear">The Year to get data for</param> <returns>True if the timezone operates daylight time in the year specified</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function StandardTimeEnd(const aYear: word): TDateTime;

<summary>Get the end point of standard time</summary> <param name="aYear">The Year to get data for</param> <returns>The end time of standard time in timezone local time</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function StardardTimeStart(const aYear: word): TDateTime;

<summary>Get the start point of Standard time</summary> <param name="aYear">The Year to get data for</param> <returns>The start time of Standard time in timezone local time</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Public function ToISO8601Str(const ADateTime: TDateTime): String;

<summary>Converts an UTC time to an ISO8601 date time string.</summary> <param name="ADateTime">The UTC time.</param> <returns>The ISO8601 date time string that corresponds to the passed UTC time.</returns>

Public function ToLocalTime(const ADateTime: TDateTime): TDateTime;

<summary>Converts an UTC time to a local time.</summary> <param name="ADateTime">The UTC time.</param> <returns>The local time that corresponds to the passed UTC time.</returns>

Public function ToUniversalTime(const ADateTime: TDateTime; const AForceDaylight: Boolean = false): TDateTime;

<summary>Converts a local time to an UTC time.</summary> <param name="ADateTime">The local time.</param> <param name="AForceDaylight">Specify a <c>True</c> value if ambiguous periods should be treated as DST.</param> <returns>The UTC time that corresponds to the passed local time.</returns> <exception cref="TZDB|ELocalTimeInvalid">The specified local time is invalid.</exception>

Protected function DoGetID: string;

<summary>Returns the ID of the timezone. An ID is a string that should uniquely identify the timezone.</summary> <returns>The ID of the timezone.</returns>

Properties

Public property Abbreviation: string read GetCurrentAbbreviation;

<summary>Returns the current time zone's abbreviation string.</summary> <returns>A string containing the abbreviation.</returns>

Public property DisplayName: string read GetCurrentDisplayName;

<summary>Returns the current time zone's display name string.</summary> <returns>A string containing the display name.</returns>

Public property ID: string read DoGetID;

<summary>Returns the ID of the timezone. An ID is a string that should uniquely identify the timezone.</summary> <returns>The ID of the timezone.</returns>

Public property UtcOffset: Int64 read GetCurrentUtcOffset;

<summary>Returns the current time zone's UTC offset.</summary> <returns>The current UTC offset.</returns>

prepared by M.Taylor
Generated by PasDoc 0.15.0.