TimeZoneInfo.TransitionTime TimeZoneInfo.TransitionTime TimeZoneInfo.TransitionTime TimeZoneInfo.TransitionTime Struct

定义

提供有关特定时区中特定时间更改(例如从夏时制更改为标准时间,或者从标准时间更改为夏时制)的信息。Provides information about a specific time change, such as the change from daylight saving time to standard time or vice versa, in a particular time zone.

public: value class TimeZoneInfo::TransitionTime : IEquatable<TimeZoneInfo::TransitionTime>, System::Runtime::Serialization::IDeserializationCallback, System::Runtime::Serialization::ISerializable
[System.Serializable]
public struct TimeZoneInfo.TransitionTime : IEquatable<TimeZoneInfo.TransitionTime>, System.Runtime.Serialization.IDeserializationCallback, System.Runtime.Serialization.ISerializable
type TimeZoneInfo.TransitionTime = struct
    interface ISerializable
    interface IDeserializationCallback
Public Structure TimeZoneInfo.TransitionTime
Implements IDeserializationCallback, IEquatable(Of TimeZoneInfo.TransitionTime), ISerializable
继承
TimeZoneInfo.TransitionTimeTimeZoneInfo.TransitionTimeTimeZoneInfo.TransitionTimeTimeZoneInfo.TransitionTime
属性
实现

注解

可以使用TimeZoneInfo.TransitionTime结构,以指示何时发生从标准时间到夏时制,或从夏时制回标准时间转换。You can use the TimeZoneInfo.TransitionTime structure to indicate when a transition from standard time to daylight saving time, or from daylight saving time back to standard time, occurs. 此结构支持固定日期规则和浮动日期规则。This structure supports both fixed-date rules and floating-date rules. 使用固定日期规则的 (例如凌晨 2:00 特定月特定天的时间转换Use fixed-date rules for time transitions that occur on a specific day of a specific month (such as 2:00 A.M. 11 月 3日日)。on November 3). (例如凌晨 2:00 特定月份的特定一周的某一特定日期发生的时间转换,使用浮动日期规则Use floating-date rules for time transitions that occur on a specific day of a specific week of a specific month (such as 2:00 A.M. 年 11 月的第一个星期日)。on the first Sunday of November).

下表比较了固定日期和浮动日期转换中使用的属性:The following table compares the properties used in fixed-date and floating-date transitions:

月份Month Week Day 时间Time
固定日期规则Fixed-date rule Month 不适用N/A Day TimeOfDay
浮动日期规则Floating-date rule Month Week DayOfWeek TimeOfDay

固定日期和浮动日期转换TimeOfDay属性获取发生时间更改的时间。For both fixed-date and floating-date transitions, the TimeOfDay property gets the time at which the time change occurs. 对于从标准为夏时制的转换,这是时区的标准时间值。For transitions from standard to daylight saving time, this is the time zone's standard time value. 对于从标准时间到夏时制的转换,这是时区的夏时制值。For transitions from daylight saving to standard time, this is the time zone's daylight saving time value. 这是DateTime值的日期组件已被忽略; 其年、 月和日值必须始终为 1。This is a DateTime value whose date component is ignored; its year, month, and day value must always equal 1.

备注

实例TimeZoneInfo.TransitionTime结构是固定不变。An instance of the TimeZoneInfo.TransitionTime structure is immutable. 一旦已创建一个对象,不能修改其值。Once an object has been created, its values cannot be modified.

一个TimeZoneInfo.TransitionTime可以通过调用创建对象static(Shared在 Visual Basic 中)CreateFixedDateRuleCreateFloatingDateRule分别创建固定或浮动日期规则的方法。A TimeZoneInfo.TransitionTime object can be created by calling the static (Shared in Visual Basic) CreateFixedDateRule and CreateFloatingDateRule methods to create a fixed or floating-date rule, respectively. 起始和结束TimeZoneInfo.TransitionTime对象随后会作为参数提供CreateAdjustmentRule方法来创建包含此转换的时间信息的新调整规则。The starting and ending TimeZoneInfo.TransitionTime objects are then supplied as parameters to the CreateAdjustmentRule method to create a new adjustment rule that includes this transition time information.

DaylightTransitionStartDaylightTransitionEnd的属性TimeZoneInfo.AdjustmentRule对象返回TimeZoneInfo.TransitionTime对象。The DaylightTransitionStart and DaylightTransitionEnd properties of an TimeZoneInfo.AdjustmentRule object return a TimeZoneInfo.TransitionTime object.

属性

Day Day Day Day

获取发生时间更改的日期。Gets the day on which the time change occurs.

DayOfWeek DayOfWeek DayOfWeek DayOfWeek

获取时间更改发生在星期几。Gets the day of the week on which the time change occurs.

IsFixedDateRule IsFixedDateRule IsFixedDateRule IsFixedDateRule

获取一个值,该值指示是在固定日期和时间(如 11 月 1 日)还是在浮动日期和时间(如 10 月的最后一个星期日)发生时间更改。Gets a value indicating whether the time change occurs at a fixed date and time (such as November 1) or a floating date and time (such as the last Sunday of October).

Month Month Month Month

获取发生时间更改的月份。Gets the month in which the time change occurs.

TimeOfDay TimeOfDay TimeOfDay TimeOfDay

获取发生时间更改的小时、分钟和秒。Gets the hour, minute, and second at which the time change occurs.

Week Week Week Week

获取时间更改发生在月中的第几个星期。Gets the week of the month in which a time change occurs.

方法

CreateFixedDateRule(DateTime, Int32, Int32) CreateFixedDateRule(DateTime, Int32, Int32) CreateFixedDateRule(DateTime, Int32, Int32) CreateFixedDateRule(DateTime, Int32, Int32)

定义一个使用固定日期规则的日期更改(即,发生在特定月份的特定日期的时间更改)。Defines a time change that uses a fixed-date rule (that is, a time change that occurs on a specific day of a specific month).

CreateFloatingDateRule(DateTime, Int32, Int32, DayOfWeek) CreateFloatingDateRule(DateTime, Int32, Int32, DayOfWeek) CreateFloatingDateRule(DateTime, Int32, Int32, DayOfWeek) CreateFloatingDateRule(DateTime, Int32, Int32, DayOfWeek)

定义一个使用浮动日期规则的日期更改(即,发生在特定月份的特定星期的特定星期几的时间更改)。Defines a time change that uses a floating-date rule (that is, a time change that occurs on a specific day of a specific week of a specific month).

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

确定是否一个对象具有与当前 TimeZoneInfo.TransitionTime 对象相同的值。Determines whether an object has identical values to the current TimeZoneInfo.TransitionTime object.

Equals(TimeZoneInfo+TransitionTime) Equals(TimeZoneInfo+TransitionTime) Equals(TimeZoneInfo+TransitionTime) Equals(TimeZoneInfo+TransitionTime)

确定当前 TimeZoneInfo.TransitionTime 对象是否具有与第二个 TimeZoneInfo.TransitionTime 对象相同的值。Determines whether the current TimeZoneInfo.TransitionTime object has identical values to a second TimeZoneInfo.TransitionTime object.

GetHashCode() GetHashCode() GetHashCode() GetHashCode()

用作哈希算法的哈希函数和数据结构(如哈希表)。Serves as a hash function for hashing algorithms and data structures such as hash tables.

操作员

Equality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Equality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Equality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Equality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime)

确定两个指定的 TimeZoneInfo.TransitionTime 对象是否相等。Determines whether two specified TimeZoneInfo.TransitionTime objects are equal.

Inequality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Inequality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Inequality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime) Inequality(TimeZoneInfo+TransitionTime, TimeZoneInfo+TransitionTime)

确定两个指定的 TimeZoneInfo.TransitionTime 对象是否不相等。Determines whether two specified TimeZoneInfo.TransitionTime objects are not equal.

显式界面实现

IDeserializationCallback.OnDeserialization(Object) IDeserializationCallback.OnDeserialization(Object) IDeserializationCallback.OnDeserialization(Object) IDeserializationCallback.OnDeserialization(Object)

在对象的反序列化完成时运行。Runs when the deserialization of an object has been completed.

ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext) ISerializable.GetObjectData(SerializationInfo, StreamingContext)

使用序列化 SerializationInfo 对象所需的数据填充此对象。Populates a SerializationInfo object with the data that is required to serialize this object.

适用于