online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code    Language
using System; class DifferenceBetweenTwoDates { static void Main() { DateTime startTime = DateTime.Now; //Current Date Console.WriteLine(startTime); string dateString = "8/6/2021 6:19:02 AM"; //If Date is in String Format.. DateTime dateFromString = DateTime.Parse(dateString); //Parse the String to the DateTime //DateTime endTime = new DateTime(2021, 6, 8, 6, 01, 20); //Date in the (yyyy,dd,mm,hh,mm,ss) format TimeSpan span = startTime.Subtract ( dateFromString ); int Secondsdiff=span.Seconds; int Minutesdiff=span.Minutes; int Hoursdiff=span.Hours; int Daysdiff=span.Days; Console.WriteLine( "Time Difference (seconds): " + Secondsdiff.ToString() ); Console.WriteLine( "Time Difference (minutes): " + Minutesdiff.ToString() ); Console.WriteLine( "Time Difference (hours): " + Hoursdiff.ToString() ); Console.WriteLine( "Time Difference (days): " + Daysdiff.ToString() ); } }

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue