Im my interface I'm letting the user input X amount of minutes that they can pause an action for.
How can i convert that into hours, minutes and seconds?
I need it to update the countdown labels to show the user the time left.
Im my interface I'm letting the user input X amount of minutes that they can pause an action for.
How can i convert that into hours, minutes and seconds?
I need it to update the countdown labels to show the user the time left.
First create TimeSpan and then format it to whatever format you want:
This is something that should give you someplace to start. The Timer is set for 1000ms. It is using the same ideas as the other answers but fleshed out a bit more.
Create a new
TimeSpan
:You now have the convenient properties
Hours
,Minutes
, andSeconds
. I should think that they are self-explanatory.