I don't believe there is a way you get 10:130:10
after you define your TimeSpan
constructor. And there is no reason to keep them becuase 10 hours + 130 minutes + 10 seconds is equal to 12:10:10
as we all know. It is a time interval, not keeps time components separately.
From TimeSpan(Int32, Int32, Int32)
constructor;
The specified hours, minutes, and seconds are converted to ticks, and that value initializes this instance.
Let's look at how this contructor defined;
public TimeSpan(int hours, int minutes, int seconds)
{
_ticks = TimeToTicks(hours, minutes, seconds);
}
And this is how TimeToTicks
methods implemented;
internal static long TimeToTicks(int hour, int minute, int second)
{
long totalSeconds = (long)hour * 3600 + (long)minute * 60 + (long)second;
if (totalSeconds > MaxSeconds || totalSeconds < MinSeconds)
throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("Overflow_TimeSpanTooLong"));
return totalSeconds * TicksPerSecond;
}
As you can see, this method doesn't keep constructor parameters (hours
, minute
or second
). It just calculate totalseconds
from hours * 3600 + minute * 60 + second
value.