如下:
var a = new TimeSpan(1, 2, 3).ToString(@"d.hh:mm:ss"); var b = DateTimeOffset.Now.ToString("yyyy-MM-dd HH:mm:ss"); var c = 12.ToString("0000"); var d = 12.ToString("0.00"); 0.01:02:03 2013-08-12 20:08:48 0012 12.00