Comparing Dates in C# , selenium RC

Example to convert string to date time variable and also compare two date time variable.
string Firstdate = selenium.GetText(FirstDate_xp);
string Nextdate = selenium.GetText(Nextdate_xp);
DateTime date1 = Convert.ToDateTime(Firstdate);
DateTime date2 = Convert.ToDateTime(Nextdate);
int result = DateTime.Compare(date1, date2);
//Compare function returns
//0 if both dates are equal
//1 if date1 is recent than date2
//-1 if date2 is recent than date1

If you found this solution helpful or have something extra to add, feel free to share it here by commenting below.