다음을 통해 공유


TimeZoneInfo.TransitionTime.Equals 메서드

정의

두 가지 TimeZoneInfo.TransitionTime 개체의 값이 동일한지 여부를 확인합니다.

오버로드

Equals(Object)

개체에 현재 TimeZoneInfo.TransitionTime 개체와 동일한 값이 있는지 여부를 결정합니다.

Equals(TimeZoneInfo+TransitionTime)

현재 TimeZoneInfo.TransitionTime 개체에 두 번째 TimeZoneInfo.TransitionTime 개체와 동일한 값이 있는지 여부를 결정합니다.

Equals(Object)

개체에 현재 TimeZoneInfo.TransitionTime 개체와 동일한 값이 있는지 여부를 결정합니다.

public:
 override bool Equals(System::Object ^ obj);
public override bool Equals (object? obj);
public override bool Equals (object obj);
override this.Equals : obj -> bool
Public Overrides Function Equals (obj As Object) As Boolean

매개 변수

obj
Object

현재 TimeZoneInfo.TransitionTime 개체와 비교할 개체입니다.

반환

Boolean

두 개체가 같으면 true이고, 그러지 않으면 false입니다.

예제

다음 예제에서는 메서드 호출을 보여 줍니다 Equals .

TimeZoneInfo.TransitionTime tt1 = TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 02, 00, 00), 11, 03);
TimeZoneInfo.TransitionTime tt2 = TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 02, 00, 00), 11, 03);
TimeZoneInfo.TransitionTime tt3 = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(new DateTime(1, 1, 1, 02, 00, 00), 10, 05, DayOfWeek.Sunday);
TimeZoneInfo tz = TimeZoneInfo.Local;
Console.WriteLine(tt1.Equals(tz));         // Returns False (overload with argument of type Object)
Console.WriteLine(tt1.Equals(tt1));        // Returns True (an object always equals itself)
Console.WriteLine(tt1.Equals(tt2));        // Returns True (identical property values)
Console.WriteLine(tt1.Equals(tt3));        // Returns False (different property values)
let tt1 = TimeZoneInfo.TransitionTime.CreateFixedDateRule(DateTime(1, 1, 1, 02, 00, 00), 11, 03)
let tt2 = TimeZoneInfo.TransitionTime.CreateFixedDateRule(DateTime(1, 1, 1, 02, 00, 00), 11, 03)
let tt3 = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(DateTime(1, 1, 1, 02, 00, 00), 10, 05, DayOfWeek.Sunday)
let tz = TimeZoneInfo.Local
printfn $"{tt1.Equals tz}"         // Returns False (overload with argument of type Object)
printfn $"{tt1.Equals tt1}"        // Returns True (an object always equals itself)
printfn $"{tt1.Equals tt2}"        // Returns True (identical property values)
printfn $"{tt1.Equals tt3}"        // Returns False (different property values)
Dim tt1 As TimeZoneInfo.TransitionTime = TimeZoneInfo.TransitionTime.CreateFixedDateRule(#02:00:00AM#, 11, 03)
Dim tt2 As TimeZoneInfo.TransitionTime = TimeZoneInfo.TransitionTime.CreateFixedDateRule(#02:00:00AM#, 11, 03)
Dim tt3 As TimeZoneInfo.TransitionTime = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(#02:00:00AM#, 10, 05, DayOfWeek.Sunday)
Dim tz As TimeZoneInfo = TimeZoneInfo.Local
Console.WriteLine(tt1.Equals(tz))          ' Returns False (overload with argument of type Object)
Console.WriteLine(tt1.Equals(tt1))         ' Returns True (an object always equals itself)
Console.WriteLine(tt1.Equals(tt2))         ' Returns True (identical property values)
Console.WriteLine(tt1.Equals(tt3))         ' Returns False (different property values)

설명

같음은 다음과 같이 정의됩니다. 매개 변수는 obj 개체여야 TimeZoneInfo.TransitionTime 하며 현재 TimeZoneInfo.TransitionTime 개체와 동일한 속성 값을 가져야 합니다.

적용 대상

Equals(TimeZoneInfo+TransitionTime)

현재 TimeZoneInfo.TransitionTime 개체에 두 번째 TimeZoneInfo.TransitionTime 개체와 동일한 값이 있는지 여부를 결정합니다.

public:
 virtual bool Equals(TimeZoneInfo::TransitionTime other);
public bool Equals (TimeZoneInfo.TransitionTime other);
override this.Equals : TimeZoneInfo.TransitionTime -> bool
Public Function Equals (other As TimeZoneInfo.TransitionTime) As Boolean

매개 변수

other
TimeZoneInfo.TransitionTime

현재 인스턴스와 비교할 개체입니다.

반환

Boolean

두 개체에 동일한 속성 값이 있으면 true이고, 그렇지 않으면 false입니다.

구현

예제

다음 예제에서는 메서드 호출을 보여 줍니다 Equals .

TimeZoneInfo.TransitionTime tt1 = TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 02, 00, 00), 11, 03);
TimeZoneInfo.TransitionTime tt2 = TimeZoneInfo.TransitionTime.CreateFixedDateRule(new DateTime(1, 1, 1, 02, 00, 00), 11, 03);
TimeZoneInfo.TransitionTime tt3 = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(new DateTime(1, 1, 1, 02, 00, 00), 10, 05, DayOfWeek.Sunday);
Console.WriteLine(tt1.Equals(tt1));        // Returns True (an object always equals itself)
Console.WriteLine(tt1.Equals(tt2));        // Returns True (identical property values)
Console.WriteLine(tt1.Equals(tt3));        // Returns False (different property values)
let tt1 = TimeZoneInfo.TransitionTime.CreateFixedDateRule(DateTime(1, 1, 1, 02, 00, 00), 11, 03)
let tt2 = TimeZoneInfo.TransitionTime.CreateFixedDateRule(DateTime(1, 1, 1, 02, 00, 00), 11, 03)
let tt3 = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(DateTime(1, 1, 1, 02, 00, 00), 10, 05, DayOfWeek.Sunday)
printfn $"{tt1.Equals tt1}"        // Returns True (an object always equals itself)
printfn $"{tt1.Equals tt2}"        // Returns True (identical property values)
printfn $"{tt1.Equals tt3}"        // Returns False (different property values)
Dim tt1 As TimeZoneInfo.TransitionTime = TimeZoneInfo.TransitionTime.CreateFixedDateRule(#02:00:00AM#, 11, 03)
Dim tt2 As TimeZoneInfo.TransitionTime = TimeZoneInfo.TransitionTime.CreateFixedDateRule(#02:00:00AM#, 11, 03)
Dim tt3 As TimeZoneInfo.TransitionTime = TimeZoneInfo.TransitionTime.CreateFloatingDateRule(#02:00:00AM#, 10, 05, DayOfWeek.Sunday)
Console.WriteLine(tt1.Equals(tt1))         ' Returns True (an object always equals itself)
Console.WriteLine(tt1.Equals(tt2))         ' Returns True (identical property values)
Console.WriteLine(tt1.Equals(tt3))         ' Returns False (different property values)

설명

TimeZoneInfo.TransitionTime 개체가 같은지 여부를 확인하기 위해 이 메서드는 속성별 비교를 수행합니다. 메서드는 현재 TimeZoneInfo.TransitionTime 개체와 개체의 other 6개 속성 값 각각 TimeZoneInfo.TransitionTime 에 대해 동일한 값을 갖는 경우에만 반환 true 됩니다.

적용 대상