.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Easy Web
Imran Ghani

Home >> Forum >> Windows Application >> Post New QuestionBookmark and Share Subscribe to Forum

display dynamic time

Posted By: Madhu Gowda     Posted Date: February 21, 2011    Points:2   Category :Windows Application
I thought to make code for an application which should display duration between current time and system login time.
i been confused to above coding part.
plz guide me

Thanx in advance.

Author: Jayakumar             
Posted Date: February 21, 2011     Points: 5   


this is current time Your System time below code


Name : R.Jayakumar(JK)
Email Id : kumaraspcode2009@gmail.com
Author: Sunil Yadav       [Moderator]   Accepted Answer   
Posted Date: February 21, 2011     Points: 10   


You can store login time of the user in a global variable and then calculate duration between them.

To display dynamic time, you can use Timer Control.

Drag and Drop Timer control and on Tick event write the following code.

For ex :
 private void timer1_Tick(object sender, EventArgs e)
DateTime loginTime = loginTime;//First login time

TimeSpan span = DateTime.Now.Subtract(loginTime);


//Sililarly you can find Minutes,Seconds,days

Post Reply

You must Sign In To post reply
Find more Forum Questions on C#, ASP.Net, Vb.Net, SQL Server and more Here
Quick Links For Forum Categories:
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  OOPs  SilverlightIISJQuery

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend