TimeSpan beginners question
C#
2
Posts
2
Posters
0
Views
1
Watching
-
Hi All, I have timespan object: TimeSpan ts= new TimeSpan(0, 72, 1); when i say : MessageBox.Show(ts.ToString()); then i get: 01:12:02 What is that means?? 1 days, 12 hours and 2 minutes??? Thanx.
-
Hi All, I have timespan object: TimeSpan ts= new TimeSpan(0, 72, 1); when i say : MessageBox.Show(ts.ToString()); then i get: 01:12:02 What is that means?? 1 days, 12 hours and 2 minutes??? Thanx.
You're using this constructor:
public TimeSpan(int hours, int minutes, int seconds);
so you've created a timespan object for 72 minutes and 1 second. which just happens to be exactly 1 hour, 12 minutes and 1 second. (I'm assuming you've mistyped your output. it's 1 second, not 2)KamarBand wrote:
then i get: 01:12:02
Simon