Hi........
I have two date startdate 05/14/2012 12:25:00 and enddate 05/15/2012 23:21:00 like this ,
i need diffrence of this time in terms of HH:MM:SS Please suggest.......................
Thanks in advance
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
SenthilkumarPosted May 14, 2012, 7:17 AM
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.
brunda kPosted May 14, 2012, 6:46 AM
http://msdn.microsoft.com/en-us/library/ms187928.aspx
Kunal VaishyaPosted May 14, 2012, 6:38 AM
try
1955-12-13 12:43:10 Format to convert small date time
Date=convert(smalldatetime, '2012-12-13 22:40:00')
let me know tit work or not
sathish kumarPosted May 19, 2012, 1:20 AM
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....
VulpesPosted May 14, 2012, 6:33 AM