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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Kunal VaishyaRank #990 · 2K reputationPosted May 14, 2012, 2:38 AM EDT
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
brunda kRank #3,804 · 389 reputationPosted May 14, 2012, 2:46 AM EDT
http://msdn.microsoft.com/en-us/library/ms187928.aspx
SenthilkumarRank #387 · 6.5K reputationPosted May 14, 2012, 3:17 AM EDT
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.
VulpesRank #55 · 29.2K reputationPosted May 14, 2012, 2:33 AM EDT
sathish kumar115 reputationPosted May 18, 2012, 9:20 PM EDT
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....