Header Ads

COMPARE DATE TIME IN C#


DateTime t1 = DateTime.Now;
DateTime t2 = Convert.ToDateTime(”9:47:00 AM”);DateTime t3 = Convert.ToDateTime(”10:02:00 AM”);
int i = DateTime.Compare(t1, t2);
if (t1 < t2){MessageBox.Show(”present”);}
else if (t1 t2 ){MessageBox.Show(”late”);}
else{MessageBox.Show(”absent”);}

No comments:


Powered by Blogger.