0
Hi,
when you compare the date time, always you need to ensure that you are checking the date time format in equally. Otherwise you need to convert into common format which will solve your business requirement.
Accepted 0
yr D m Hr Min Sec
DateTime startDate= new DateTime(2005 ,2 ,1 ,3, 4 , 56);
DateTime EndDate= new DateTime(2008,2,1,3,4,12);
TimeSpan DiffDate= EndDate.Subtract(StartDate)
console.writline(DiffDate.Days.Tostring() + "Days"); ---DateWise Diff
console.writline(DiffDate.Hours.Tostring() + "Hours");
console.writline(DiffDate.Minutes.Tostring() + "Minutes");
Tryout this....
0
Does it work if you re-express the date in this format?
'2012-03-30 22:40:00'