Datetime dt = datetime.now;
//Label1.text = dt.toString (); // 2005-11-5 13:21:25
//Label2.text = dt.tofiletime (). ToString (); // 127756416859912816
//Label3.text = dt.tofiletimeutc (). ToString (); // 127756704859912816
//Label4.text = dt.Tolocaltime (). ToString (); // 2005-11-5 21:21:25
//Label5.text = dt.tolongDateString (). ToString (); // 2005 年 11月 5 日
//Label6.text = dt.tolongtimestring (). ToString (); // 13:21:25
//Label7.text = dt.tooadate (). ToString (); // 38661.5565508218
//Label8.text = dt.toshortDateString (). ToString (); // 2005-11-5
//Label9.text = dt.toshortTimestring (). ToString (); // 13:21
//Label10.text = dt.touniversaltime (). ToString (); // 2005-11-5 5:21:25
// 2005-11-5 13: 30: 28.4412864
//Label1.text = dt.year.toString (); // 2005
//Label2.text = dt.date.toString (); // 2005-11-5 0:00:00
//Label3.text = dt.dayofweek.tostring (); // Sabtu
//Label4.text = dt.dayofyear.toString (); // 309
//Label5.text = dt.hour.toString (); // 13
//Label6.text = dt.millisecond.toString (); // 441
//Label7.text = dt.minute.toString (); // 30
//Label8.text = dt.month.toString (); // 11
//Label9.text = dt.second.tostring (); // 28
//Label10.text = dt.ticks.tostring (); // 632667942284412864
//Label11.text = dt.timeofday.toString (); // 13: 30: 28.4412864
//Label1.text = dt.toString (); // 2005-11-5 13:47:04
//Label2.text = dt.addyears (1) .toString (); // 2006-11-5 13:47:04
//Label3.text = dt.adddays (1.1) .toString (); // 2005-11-6 16:11:04
//Label4.text = dt.addhours (1.1) .toString (); // 2005-11-5 14:53:04
//Label5.text = dt.addmilliseconds (1.1) .toString (); // 2005-11-5 13:47:04
//Label6.text = dt.addmonths (1) .toString (); // 2005-12-5 13:47:04
//Label7.text = dt.addseconds (1.1) .toString (); // 2005-11-5 13:47:05
//Label8.text = dt.addminutes (1.1) .toString (); // 2005-11-5 13:48:10
//Label9.text = dt.addticks (1000) .toString (); // 2005-11-5 13:47:04
//Label10.text = dt.compareto (dt) .toString (); // 0
////Label11.text = dt.add (?). ToString (); // 问号为一个时间段
//Label1.text = dt.equals ("2005-11-6 16:11:04"). ToString (); // false
//Label2.text = dt.equals (dt) .toString (); // true
//Label3.text = dt.getHashCode (). ToString (); // 1474088234
//Label4.text = dt.getType (). ToString (); // System.DateTime
//Label5.text = dt.getTypeCode (). ToString (); // datetime
//Label1.text = dt.getDateTimeFormats ('s') [0] .toString (); // 2005-11-05t14: 06: 25
//Label2.text = dt.getDateTimeFormats ('t') [0] .toString (); // 14:06
//Label3.text = dt.getDateTimeFormats ('y') [0] .toString (); // 2005 年 11月
//Label4.text = dt.getDateTimeFormats ('d') [0] .toString (); // 2005 年 11月 5 日
//Label5.text = dt.getDateTimeFormats ('d') [1] .toString (); // 2005 11 05
//Label6.text = dt.getDateTimeFormats ('d') [2] .toString (); // 星期六 2005 11 05
//Label7.text = dt.getDateTimeFormats ('d') [3] .toString (); // 星期六 2005 年 11月 5 日
//Label8.text = dt.getDateTimeFormats ('m') [0] .toString (); // 11月 5 日
//Label9.text = dt.getDateTimeFormats ('f') [0] .toString (); // 2005 年 11月 5 日 14:06
//Label10.text = dt.getDateTimeFormats ('g') [0] .toString (); // 2005-11-5 14:06
//Label11.text = dt.getDateTimeFormats ('r') [0] .toString (); // Sat, 05 Nov 2005 14:06:25 GMT
Label1.text = string.Format ("{0: d}", dt); // 2005-11-5
Label2.text = string.Format ("{0: d}", dt); // 2005 年 11月 5 日
Label3.text = string.Format ("{0: f}", dt); // 2005 年 11月 5 日 14:23
Label4.text = string.Format ("{0: f}", dt); // 2005 年 11月 5 日 14:23:23
Label5.text = string.Format ("{0: g}", dt); // 2005-11-5 14:23
Label6.text = string.Format ("{0: g}", dt); // 2005-11-5 14:23:23
Label7.text = string.Format ("{0: m}", dt); // 11月 5 日
Label8.text = string.Format ("{0: r}", dt); // sat, 05 Nov 2005 14:23:23 GMT
Label9.text = string.format ("{0: s}", dt); // 2005-11-05t14: 23: 23
Label10.text = string.Format ("{0: t}", dt); // 14:23
Label11.text = string.Format ("{0: t}", dt); // 14:23:23
Label12.text = string.Format ("{0: u}", dt); // 2005-11-05 14: 23: 23z
Label13.text = string.format ("{0: u}", dt); // 2005 年 11月 5 日 6:23:23
Label14.text = string.Format ("{0: y}", dt); // 2005 年 11月
Label15.text = string.Format ("{0}", dt); // 2005-11-5 14:23:23
Label16.text = string.Format ("{0: yyyymmddhhmmssffff}", dt);