Hello Team,
I am facing an issue while identifying the difference in dates. Here is my code:-
using System;
Console.WriteLine(DateDifference(z, a));
Console.ReadLine();
}
public static string DateDifference(string x, string y)
{
namespace Date_Difference
{
class Program
{
static void Main(string[] args)
{
string z = "2018, 11, 06";
string a = "2019, 11, 11";
{
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;
}
}
}
return difference;
}
}
}
Can someone please help me to fix this issue.

Dhara PatelPosted Nov 15, 2019, 5:09 AM
Mageshwaran RPosted Nov 14, 2019, 9:29 AM
Jaspreet SinghPosted Nov 7, 2019, 5:28 AM
{
public class Program
{
public int DateDifference(DateTime x, DateTime y)
{
DateTime start = x;
DateTime end = y;
TimeSpan difference = end - start;
return difference.Days;
}
}
}
Rupesh KahanePosted Nov 7, 2019, 5:05 AM