3
Reply

Login and logout time calculation

MohanRaj C

MohanRaj C

Apr 24 2012 1:28 AM
1.5k
DateTime StartTime = DateTime.Now.ToLocalTime(); 
DateTime EndTime = DateTime.Now.ToLocalTime(); 
string dt = EndTime.Subtract(StartTime).ToString().Split('.')[0].ToString(); 
button1.Text = dt; 

starttime = session["logintime"].tostring();



endtime=currenttime...

i have error in retriving the starttime values(ie,session)

if i run this code...it displays the starttime value like 12:00:00


i need this type of output


StartTime:8/7/2010 3:31:16 PM 
EndTime:8/7/2010 3:32:00PM 

OutPut:  

dt=00:00:44

Answers (3)