如何檢查日期是大於或等於日期比較
DateTime StartDate = Convert.ToDateTime(TxtStrtDate.Text);
DateTime ExpirationDate = Convert.ToDateTime(TxtExpDte.Text);
如何檢查日期是大於或等於日期比較
DateTime StartDate = Convert.ToDateTime(TxtStrtDate.Text);
DateTime ExpirationDate = Convert.ToDateTime(TxtExpDte.Text);
DateTime.Compare()
是我能想到的最簡單的方法。
如何
bool b = ExpirationDate >= StartDate;
閱讀本DateTime.GreaterThanOrEqual Operator
OR
int i = DateTime.Compare(ExpirationDate, StartDate);
//if ExpirationDate is less than StartDate then result is Less than zero
//if ExpirationDate equals StartDate then result is Zero
//if ExpirationDate is greater than StartDate then result is Greater than zero
0%接受... – Nope
請閱讀:http://stackoverflow.com/faq#howtoask並標記您的問題的答案。 –
我該如何改善這個問題,由於負面 – user1196392