📜  asp net c#比较日期到当前 - C#代码示例

📅  最后修改于: 2022-03-11 14:49:15.441000             🧑  作者: Mango

代码示例1
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");
                }