I need to create a variable containing time in the format hh: mm, how to do it?
DateTime currentTime = "00:00";
doesn't seem to do the trick. I need to add hours / minutes to the loop to this variable and save the format "hh: mm". How it's done?
/ M
Perhaps used for this TimeSpan?
TimeSpan
You must distinguish between the amount you are trying to track and the possible formatting of the string. They are different.
( DateTime , , ) ( TimeSpan )? , , , .
DateTime
( -, Noda Time, ; Joda Time Java. -, , :)
DateTime current; DateTime.TryParse("13:00", out current);
,
current.ToString("hh:mm");
Timespan is your best bet or use DateTime.toString ("hh: mm")
You can use the regular datetime variable with the current date starting at midnight.
A prime integer? hours = number / 60; minutes = number % 60
hours = number / 60; minutes = number % 60