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

Top 5 Contributors of the Month

Home >> Forum >> C# >> Post New QuestionBookmark and Share Subscribe to Forum

How to get running server time

Posted By: akash     Posted Date: May 13, 2010    Points:2   Category :C#
I need to get running time in ASP.NET(C#)
please help with code

Author: Amit Mehra             
Posted Date: May 13, 2010     Points: 5   

Hello Akash,

You can get the current time by using DateTime object

for example

DateTime dt = DateTime.Now.ToString("dd/MM/YYYY");

Hope I understood your question correctly

Please "Mark As Answer " if this post help you.
Author: BangaruBabuPureti             
Posted Date: May 13, 2010     Points: 5   

Check Out the Following Code

string serTime = DateTime.Now.ToShortTimeString();

I Hope this Will Help

BangaruBabu Pureti
Author: Lalij Mer             
Posted Date: May 13, 2010     Points: 5   

check below link will help


Please Check my answer if you help....
Thank You...

Author: Sunil Yadav       [Moderator]   Accepted Answer   
Posted Date: May 24, 2010     Points: 10   

I guess you are talking about displaying time in hh:mm:ss in which ss will continuously change its value.

To achieve the above u need to use ajax update panel and timer control of it.

Write a code on Timer1_Tick event as


Make sure that you have set timer1 duration property to 1 sec.

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