C# 只有小时和分钟的两个时间进行对比

string a = "12:17";
            string b = "12:17";
            int c = DateTime.Compare(Convert.ToDateTime(b), Convert.ToDateTime(a));
            if (c == 0)
            {
                MessageBox.Show("两个时间相同");
            }
posted @ 2020-01-07 11:07  饮木  阅读(1008)  评论(0编辑  收藏  举报