国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

C#日期函數所有樣式大全

2024-07-21 02:25:48
字體:
來源:轉載
供稿:網友

最大的網站源碼資源下載站,

 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();//saturday
//   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);

 

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 耒阳市| 长垣县| 厦门市| 洛浦县| 共和县| 长寿区| 阳新县| 聂拉木县| 海南省| 达孜县| 乌苏市| 阿克| 峨山| 田林县| 东辽县| 额敏县| 泉州市| 宁晋县| 红安县| 民和| 吉木萨尔县| 连州市| 吉隆县| 迁安市| 彰化市| 大姚县| 汉阴县| 石门县| 兴城市| 阆中市| 高安市| 南京市| 阜新| 临沂市| 且末县| 溧阳市| 葫芦岛市| 集安市| 酒泉市| 百色市| 凌海市|