NevronOpenVision
Nevron.Nov Namespace / NTimeZone Class / CreateCustom Method
The time zone's identifier.
A System.TimeSpan object that represents the time difference between this time zone and Coordinated Universal Time (UTC).
The display name of the new time zone.
The standard time name of the new time zone.
The daylight saving time name of the new time zone.
An array of NTimeZoneInfo.AdjustmentRule objects that augment the base UTC offset for a particular period.
true to discard any daylight saving time-related information present in adjustmentRules with the new object; otherwise, false.
In This Topic
    CreateCustom Method
    In This Topic
    Creates a custom time zone with a specified identifier, an offset from Coordinated Universal Time (UTC), a display name, a standard time name, a daylight saving time name, daylight saving time rules, and a value that indicates whether the returned object reflects daylight saving time information.
    Syntax
    public static NTimeZone CreateCustom( 
       System.string id,
       System.TimeSpan baseUtcOffset,
       System.string displayName,
       System.string standardDisplayName,
       System.string daylightDisplayName,
       NAdjustmentRule[] adjustmentRules,
       System.bool disableDaylightSavingTime
    )

    Parameters

    id
    The time zone's identifier.
    baseUtcOffset
    A System.TimeSpan object that represents the time difference between this time zone and Coordinated Universal Time (UTC).
    displayName
    The display name of the new time zone.
    standardDisplayName
    The standard time name of the new time zone.
    daylightDisplayName
    The daylight saving time name of the new time zone.
    adjustmentRules
    An array of NTimeZoneInfo.AdjustmentRule objects that augment the base UTC offset for a particular period.
    disableDaylightSavingTime
    true to discard any daylight saving time-related information present in adjustmentRules with the new object; otherwise, false.

    Return Value

    The new time zone. If the disableDaylightSavingTime parameter is true, the returned object has no daylight saving time data.
    Exceptions
    ExceptionDescription
    The id parameter is null.
    The id parameter is an empty string ("").-or-The baseUtcOffset parameter does not represent a whole number of minutes.
    The baseUtcOffset parameter is greater than 14 hours or less than -14 hours.
    The adjustment rules specified in the adjustmentRules parameter overlap.-or-The adjustment rules specified in the adjustmentRules parameter are not in chronological order.-or-One or more elements in adjustmentRules are null.-or-A date can have multiple adjustment rules applied to it.-or-The sum of the baseUtcOffset parameter and the NAdjustmentRule.DaylightDelta value of one or more objects in the adjustmentRules array is greater than 14 hours or less than -14 hours.
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 7, Windows Server 2019, Windows Server 2016, Windows Server 2012 R2, Windows Server 2012, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later)

    See Also