tags:

views:

44

answers:

3

I want to make an app that adds 1 minutes and 25 seconds to a TimeLeft variable.

Problem is I have no idea what type of variable this should be, or even how to add 1 minutes 25 seconds to the available time left.

Any guidance would be much appreciated. I'm good with C#, but since I've never done something like, I'm in the dark.

A: 

Use the DateTime type. Assuming your TimeLeft variable is an integer, you probably need to convert it to DateTime type first and then perform the add. More information here

Freddy
+1  A: 

TimeSpan works well.

Jacob
+4  A: 

Hi, I would suggest you use a DateTime variable. This will let you manipulate the time. If you want to add 1m 25s to a varible, you could simply use:

DateTime newTime = DateTime.Now.AddSeconds(85);

That will add 85 seconds onto the current time (or, in your case, TimeLeft as long as the TimeLeft variable is also a DateTime type)

keyboardP