Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想比较 C# 中的两个日期我尝试过 Toshortdate() 但它对我不起作用我不知道为什么?我只想比较日期而不是时间。我的代码如下:
Convert.ToDateTime(b.CreatedDate).ToShortDateString() == Convert.ToDateTime(objbreedable.LastBDate).ToShortDateString()
请帮我。
使用日期属性。
Convert.ToDateTime(b.CreatedDate).Date == Convert.ToDateTime(objbreedable.LastBDate).Date