Answers for "how to compare date with c#"

C#
1

asp net c# compare date to current

string date = "01/04/2013";
                DateTime myDate = DateTime.ParseExact(date, "dd/MM/yyyy",
                                           System.Globalization.CultureInfo.InvariantCulture);
                if (myDate > DateTime.Today)
                {
                    Console.WriteLine("greater than");
                }
               else
                {
                 Console.WriteLine("Less Than");
                }
Posted by: Guest on September-21-2020

Code answers related to "how to compare date with c#"

C# Answers by Framework

Browse Popular Code Answers by Language