c#日期函数所有样式大全
1、datetime 数字型
system.datetime currenttime=new system.datetime();
1.1 取当前年月日时分秒
currenttime=system.datetime.now;
1.2 取当前年
int 年=currenttime.year;
1.3 取当前月
int 月=currenttime.month;
1.4 取当前日
int 日=currenttime.day;
1.5 取当前时
int 时=currenttime.hour;
1.6 取当前分
int 分=currenttime.minute;
1.7 取当前秒
int 秒=currenttime.second;
1.8 取当前毫秒
int 毫秒=currenttime.millisecond;
(变量可用中文)2、int32.parse(变量) int32.parse("常量")
字符型转换 转为32位数字型
1.9 取中文日期显示——年月日时分
string stry=currenttime.tostring("f"); //不显示秒
1.10 取中文日期显示_年月
string strym=currenttime.tostring("y");
1.11 取中文日期显示_月日
string strmd=currenttime.tostring("m");
1.12 取当前年月日,格式为:2003-9-23
string strymd=currenttime.tostring("d");
1.13 取当前时分,格式为:14:24
string strt=currenttime.tostring("t");
label1.text = string.format("{0:d}",dt);//2005-11-5
label2.text = string.format("{0}",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);
樱花校园模拟器4399中文版
樱花校园模拟器4399中文版,十分奇趣好玩的3d校园冒险模拟
我的暑假秘密回忆繁星新春版
我的暑假秘密回忆繁星新春版是一款少女模拟养成类休闲游戏。这款
樱花校园模拟器国际版
樱花校园模拟器国际版,一个超级自由超级好玩的自由恋爱模拟的游
饥荒海难九游版
饥荒海难九游版,带你去真实的海岛上感受一下什么才是真正的孤岛
盖瑞模组体验版最新版
盖瑞模组体验版是玩法非常丰富多元化的沙盒建造游戏,玩家可以在