AFTimeZone Class
- Last UpdatedNov 18, 2025
- 8 minute read
- PI System
- AF SDK 2024 R2
- Developer
Represents information about a time zone.

Inheritance Hierarchy
SystemObject
SystemTimeZone
OSIsoft.AF.TimeAFTimeZone
SystemTimeZone
OSIsoft.AF.TimeAFTimeZone
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
[SerializableAttribute] public sealed class AFTimeZone : TimeZone, ISerializable, IComparable, IComparable<AFTimeZone>, IEquatable<AFTimeZone>
<SerializableAttribute> Public NotInheritable Class AFTimeZone Inherits TimeZone Implements ISerializable, IComparable, IComparable(Of AFTimeZone), IEquatable(Of AFTimeZone) Dim instance As AFTimeZone
[SerializableAttribute] public ref class AFTimeZone sealed : public TimeZone, ISerializable, IComparable, IComparable<AFTimeZone^>, IEquatable<AFTimeZone^>
[<SealedAttribute>] [<SerializableAttribute>] type AFTimeZone = class inherit TimeZone interface ISerializable interface IComparable interface IComparable<AFTimeZone> interface IEquatable<AFTimeZone> end
The AFTimeZone type exposes the following members.
Constructors
| Name | Description | |
|---|---|---|
| AFTimeZone |
Creates a new AFTimeZone instance representing the current
time zone of the local computer system.
|
Properties
| Name | Description | |
|---|---|---|
| BaseUtcOffset |
Gets the time difference between the current time zone's standard time and Coordinated Universal Time (UTC).
| |
| CurrentAFTimeZone |
Returns the AFTimeZone representing the current time zone of the
local computer system.
| |
| DaylightName |
Gets the localized display name for the current time zone's daylight saving time.
(Overrides TimeZoneDaylightName.) | |
| DisplayName |
The localized general display name that represents the time zone.
| |
| Name |
The invariant culture name of the time zone.
| |
| StandardName |
Gets the localized display name for the time zone's standard time.
(Overrides TimeZoneStandardName.) | |
| SupportsDaylightSavingsTime |
Get a value indicating whether the time zone has any daylight saving time rules.
| |
| UtcTimeZone |
Returns the AFTimeZone representing Coordinated Universal Time (UTC) zone.
|
Methods
| Name | Description | |
|---|---|---|
| ClearCachedData |
Clears cached time zone data.
| |
| CompareTo(Object) |
Compares this instance with a specified Object.
| |
| CompareTo(AFTimeZone) |
Compares this instance with a specified AFTimeZone.
| |
| CreateCustomTimeZone |
Creates a custom AFTimeZone with a specified identifier, an offset from
Coordinated Universal Time (UTC), a display name, a standard time name, a daylight savings
time name, daylight saving time rules, and a value indicates whether the returned object
reflects daylight saving time information.
| |
| Equals(Object) |
Determines whether the specified Object is equal to the current object.
(Overrides ObjectEquals(Object).) | |
| Equals(AFTimeZone) |
Indicates whether the current object is equal to another object of the same type.
| |
| FromName |
Gets a AFTimeZone which corresponds to the specified
time zone invariant culture name.
| |
| GetDaylightChanges |
Returns the daylight saving time period for a particular year.
(Overrides TimeZoneGetDaylightChanges(Int32).) | |
| GetHashCode |
Gets the hash code for this instance of the object which is suitable for use in hashing
algorithms and data structures like a hash table.
(Overrides ObjectGetHashCode.) | |
| GetSystemTimeZones |
Retrieves a list of AFTimeZone objects by pulling values
from the registry.
| |
| GetType | Gets the Type of the current instance. (Inherited from Object.) | |
| GetUtcOffset |
Calculates the offset or difference between the time in this time zone and the
Coordinated Universal Time (UTC) for a particular date and time.
(Overrides TimeZoneGetUtcOffset(DateTime).) | |
| IsDaylightSavingTime |
Returns a value indicating whether a specified date and time is within a
daylight savings time period.
(Overrides TimeZoneIsDaylightSavingTime(DateTime).) | |
| LoadSystemTimeZones |
Load the system time zones from XML.
| |
| SaveSystemTimeZones |
Save the system time zones to XML.
| |
| ToLocalTime(DateTime) |
Returns the local time that corresponds to a specified time.
(Overrides TimeZoneToLocalTime(DateTime).) | |
| ToLocalTime(AFTimeZone, DateTime) |
Convert a DateTime to the specified AFTimeZone.
| |
| ToString |
Returns a String that represents the current object.
(Overrides ObjectToString.) | |
| ToString(IFormatProvider) |
Returns a String that represents the current object.
| |
| ToUniversalTime(DateTime) |
Returns the Coordinated Universal Time (UTC) that corresponds to a specified time.
(Overrides TimeZoneToUniversalTime(DateTime).) | |
| ToUniversalTime(AFTimeZone, DateTime) |
Convert a DateTime from the specified AFTimeZone.
|
Operators
| Name | Description | |
|---|---|---|
| Equality |
The equality operator (==) compares its operands to determine if they are equal.
| |
| GreaterThan |
The greater than relation operator (>) compares its operands to determine
which one is greater than the other.
| |
| GreaterThanOrEqual |
The greater than or equal relation operator (>=) compares its operands to determine
which one is greater than or equal to the other.
| |
| (TimeZoneInfo to AFTimeZone) |
Implicit cast operator to convert a TimeZoneInfo to an AFTimeZone.
| |
| (AFTimeZone to TimeZoneInfo) |
Implicit cast operator to convert an AFTimeZone to a TimeZoneInfo.
| |
| Inequality |
The inequality operator (!=) compares its operands to determine if they are not equal.
| |
| LessThan |
The less than relation operator (<) compares its operands to determine
which one is less than the other.
| |
| LessThanOrEqual |
The less than or equal relation operator (<=) compares its operands to determine
which one is less than or equal to the other.
|
Remarks
A time zone is a geographical region in which the same standard time is used.
This is an extension of the TimeZone class provided by the .NET Framework that provides methods to convert a time between the specified time zone's local time (see ToLocalTime Overload and ToUniversalTime Overload). This class also provides the GetSystemTimeZones method to get a list of all the currently defined time zones.
| The implementation of this class uses the .NET Framework class TimeZoneInfo. Therefore, adjustment rules created for the TimeZoneInfo class will be used by this class. |