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);
罚罪1+2全80集阿里云盘全集资源链接-罚罪1+2全集高清1080P/4K阿里云盘资源下载无删减
邵氏精品禁品未删减资源在线看-必看的50部邵氏电影无删减观看入口
羞羞漫画高清最新资源-正规平台免费入口与无删减资源导航
日漫入口-官方认证安全入口与无删减日漫资源直达导航
一拳超人漫画入口-2026最新免费高清全集在线看
杨紫《生命树》1080p全40集迅雷磁力链接分享-杨紫《生命树》40集高清完整版迅雷云盘下载1080P(4k)资源