时间字符串的比较

String date1 = txtdate1.Value;
            String date2 = txtdate2.Value;
            if (DateTime.Parse(date1.Replace("-", "/")) > DateTime.Parse(date2.Replace("-", "/")))
            {
                String temp = date1;
                date1 = date2;
                date2 = temp;
            }

今天遇到比较2个时间字符串,虽简单,但还是记下来

转载于:https://www.cnblogs.com/tian_z/archive/2010/07/21/1782156.html

你可能感兴趣的:(时间字符串的比较)