You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
usingSystem;publicclassDateArithmetic{publicstaticvoidMain(){DateTimedate1,date2;DateTimeOffsetdateOffset1,dateOffset2;TimeSpandifference;// Find difference between Date.Now and Date.UtcNowdate1=DateTime.Now;date2=DateTime.UtcNow;difference=date1-date2;Console.WriteLine("{0} - {1} = {2}",date1,date2,difference);// Find difference between Now and UtcNow using DateTimeOffsetdateOffset1=DateTimeOffset.Now;dateOffset2=DateTimeOffset.UtcNow;difference=dateOffset1-dateOffset2;Console.WriteLine("{0} - {1} = {2}",dateOffset1,dateOffset2,difference);// If run in the Pacific Standard time zone on 4/2/2007, the example// displays the following output to the console:// 4/2/2007 7:23:57 PM - 4/3/2007 2:23:57 AM = -07:00:00// 4/2/2007 7:23:57 PM -07:00 - 4/3/2007 2:23:57 AM +00:00 = 00:00:00}}
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: