Check if DateTimeOffset represents the same point in time as a specified DateTimeOffset object in CSharp
Description
The following code shows how to check if DateTimeOffset represents the same point in time as a specified DateTimeOffset object.
Example
using System;//from w w w. j ava 2 s . c o m
public class MainClass{
public static void Main(String[] argv){
DateTimeOffset firstTime = new DateTimeOffset(2014, 9, 1, 6, 45, 0,
new TimeSpan(-7, 0, 0));
DateTimeOffset secondTime = firstTime;
Console.WriteLine("{0} = {1}: {2}",
firstTime, secondTime,
firstTime.Equals(secondTime));
}
}
The code above generates the following result.