Click here to Skip to main content
15,884,970 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
Hi All,

I am using vs2008, c#.net window applicaion.
I want to set timer for 30 min or 1 hr.

Timer Format:- 00:00:01 (h:mm:ss)

My timer is set by default this type of format (00:00:01),when form is open.
how to set this type of format in c#.net.
I have tried format but did not get solution.

help will be appriecated....
mukesh
Posted
Comments
Sergey Alexandrovich Kryukov 10-Jan-12 1:31am    
So, what do you try? What do you mean by "timer"? A watch showing current time?
--SA

 
Share this answer
 
The System.Windows.Forms Timer (I assume this is the one you are using) has an interval property, which is an int type and is measured in milliseconds, so to set the timer interval to 30 minutes you just set it to 30000 ,

System.Windows.Forms.Timer timer;
            timer.Interval = 30000;


You do not have to worry about the format of the time at all.

Hope this helps
 
Share this answer
 
Comments
ADemontis 21-Jan-18 14:00pm    
would not this run every 30 seconds?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900