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.tolongtimesting (). ToString (); // 13:21:25
//Label7.text = dt.toAdate (). ToString (); // 38661.5565508218
//Label8.text = dt.toshortdatestring (). ToString (); // 2005-11-5
//Label9.text = dt.toshorttimesting (). 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 (); // суббота
//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 (); // ложь
//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 ноября 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, 5 ноября 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);