Jaspreet Singh

Jaspreet Singh

  • 2k
  • 20
  • 1k

Date difference Function

Nov 7 2019 4:19 AM
Hello Team,
 
I am facing an issue while identifying the difference in dates. Here is my code:-
 
using System;
namespace Date_Difference
{
class Program
{
static void Main(string[] args)
{
string z = "2018, 11, 06";
string a = "2019, 11, 11";

Console.WriteLine(DateDifference(z, a));
Console.ReadLine();

}
public static string DateDifference(string x, string y)
{
string difference = Convert.ToDateTime(y - x);
return difference;
}
}
}
 
Can someone please help me to fix this issue. 

Brought to you by:

Answers (6)