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"
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.
Koteswararao MallisettiPosted Dec 22, 2010, 3:32 AM
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 KPosted Dec 22, 2010, 4:38 AM
dt1 and dt2 are dates.
if(dt1- dt2>TimeSpan.FromMinutes(30))
{
Response.Write("Access Denied");
}