Hi
How can find Time difference between.A variable hold a start time and another hold end-time and has to check their difference is 30 minutes r above. if so display message "Access Denied"
Csharp web application(time difference)
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Koteswararao MallisettiRank #2,740 · 511 reputationPosted Dec 21, 2010, 10:32 PM EST
DateTime t2 = new DateTime(2010, 12, 2,1, 12, 12);
TimeSpan res = t1 - t2;
Response.Write(res);
it work fine you can assign you values into t1,t2 and you get that difference.
Madhu KRank #1,514 · 1.1K reputationPosted Dec 21, 2010, 11:38 PM EST
dt1 and dt2 are dates.
if(dt1- dt2>TimeSpan.FromMinutes(30))
{
Response.Write("Access Denied");
}