September 28, 2010
September 22, 2010
Timespan Formatting
timeSpan.ToString("hh:mm:ss") equivalent. (Only available in .Net 4!)
TimeSpan timeSpan = new TimeSpan(DateTime.UtcNow.Ticks - scriptTime.Ticks); string timeStr = timeSpan.Hours.ToString().PadLeft(2, '0') + ":" + timeSpan.Minutes.ToString().PadLeft(2, '0') + ":" + timeSpan.Seconds.ToString().PadLeft(2, '0');
Subscribe to:
Posts (Atom)