S
SpaceMarine
hello,
ive read the MSDN docs on using the TimeSpace.Pars() method to format
timespans, however i found their examples unclear.
currently i am doing this:
Dim startTime As DateTime = DateTime.Now
...
Dim endTime As DateTime = DateTime.Now
Dim elapsedTime As TimeSpan = endTime.Subtract(startTime)
writer.WriteLine("Time difference: {0} hours, {1} minutes, {2}
seconds.", elapsedTime.Hours, elapsedTime.Minutes,
elapsedTime.Seconds)
....but i get the impression there is a much simpler string formatter
technique. ive tried this, to no effect:
writer.WriteLine("Time difference: {0:hh:mm:ss}", elapsedTime)
anybody know the magic?
thanks!
sm
ive read the MSDN docs on using the TimeSpace.Pars() method to format
timespans, however i found their examples unclear.
currently i am doing this:
Dim startTime As DateTime = DateTime.Now
...
Dim endTime As DateTime = DateTime.Now
Dim elapsedTime As TimeSpan = endTime.Subtract(startTime)
writer.WriteLine("Time difference: {0} hours, {1} minutes, {2}
seconds.", elapsedTime.Hours, elapsedTime.Minutes,
elapsedTime.Seconds)
....but i get the impression there is a much simpler string formatter
technique. ive tried this, to no effect:
writer.WriteLine("Time difference: {0:hh:mm:ss}", elapsedTime)
anybody know the magic?
thanks!
sm