AFTimeZone.CreateCustomTimeZone Method
- Last UpdatedNov 18, 2025
- 3 minute read
- PI System
- AF SDK 2024 R2
- Developer
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.
Namespace: OSIsoft.AF.Time
Assembly: OSIsoft.AFSDK (in OSIsoft.AFSDK.dll) Version: 3.1.1.1182
Syntax
public static AFTimeZone CreateCustomTimeZone( string name, TimeSpan baseUtcOffset, string displayName, string standardDisplayName, string daylightDisplayName = null, TimeZoneInfoAdjustmentRule[] adjustmentRules = null, bool disableDaylightSavingTime = false )
Public Shared Function CreateCustomTimeZone ( name As String, baseUtcOffset As TimeSpan, displayName As String, standardDisplayName As String, Optional daylightDisplayName As String = Nothing, Optional adjustmentRules As TimeZoneInfoAdjustmentRule() = Nothing, Optional disableDaylightSavingTime As Boolean = false ) As AFTimeZone Dim name As String Dim baseUtcOffset As TimeSpan Dim displayName As String Dim standardDisplayName As String Dim daylightDisplayName As String Dim adjustmentRules As TimeZoneInfoAdjustmentRule() Dim disableDaylightSavingTime As Boolean Dim returnValue As AFTimeZone returnValue = AFTimeZone.CreateCustomTimeZone(name, baseUtcOffset, displayName, standardDisplayName, daylightDisplayName, adjustmentRules, disableDaylightSavingTime)
public: static AFTimeZone^ CreateCustomTimeZone( String^ name, TimeSpan baseUtcOffset, String^ displayName, String^ standardDisplayName, String^ daylightDisplayName = nullptr, array<TimeZoneInfoAdjustmentRule^>^ adjustmentRules = nullptr, bool disableDaylightSavingTime = false )
static member CreateCustomTimeZone : name : string * baseUtcOffset : TimeSpan * displayName : string * standardDisplayName : string * ?daylightDisplayName : string * ?adjustmentRules : TimeZoneInfoAdjustmentRule[] * ?disableDaylightSavingTime : bool (* Defaults: let _daylightDisplayName = defaultArg daylightDisplayName null let _adjustmentRules = defaultArg adjustmentRules null let _disableDaylightSavingTime = defaultArg disableDaylightSavingTime false *) -> AFTimeZone
Parameters
- name
- Type: SystemString
The time zone's invariant culture Name used to identify the new time zone. - baseUtcOffset
- Type: SystemTimeSpan
A TimeSpan object that represents the time difference between this time zone and Coordinated Universal Time (UTC). - displayName
- Type: SystemString
The DisplayName of the new time zone. - standardDisplayName
- Type: SystemString
The StandardName of the new time zone. - daylightDisplayName (Optional)
- Type: SystemString
The DaylightName of the new time zone. - adjustmentRules (Optional)
- Type: SystemTimeZoneInfoAdjustmentRule
An array of TimeZoneInfo.AdjustmentRule objects that augment the base UTC offset for a particular period. - disableDaylightSavingTime (Optional)
- Type: SystemBoolean
Set to to discard any daylight saving time-related information present in adjustmentRules with the new object; otherwise, set to .
Return Value
Type: AFTimeZoneThe new time zone. If the disableDaylightSavingTime parameter is , then the returned object has no daylight saving time data.