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#で2つの日付を比較したいのですが、Toshortdate()を試しましたが、機能しません。理由がわかりません。時間ではなく日付を比較したいだけです。私のコードは次のとおりです。
Convert.ToDateTime(b.CreatedDate).ToShortDateString() == Convert.ToDateTime(objbreedable.LastBDate).ToShortDateString()
私を助けてください。
Dateプロパティを使用します。
Convert.ToDateTime(b.CreatedDate).Date == Convert.ToDateTime(objbreedable.LastBDate).Date