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);
敢达决战官方正版 安卓版v6.7.9
下载敢达决战 安卓版v6.7.9
下载像素火影骨架佐助 (Perseverance Fire Shadow)手机版v1.16
下载要塞英雄 安卓版v33.20.0-39082670-Android
下载梦想城镇vivo最新版本 安卓版v12.0.1
梦想城镇vivo版是这款卡通风模拟经营类手游的渠道服版本,玩
怦然心动的瞬间 安卓版v1.0
怦然心动的瞬间是一款真人向的恋爱互动游戏,在游戏中玩家将扮演
曼尼汉堡店游戏 安卓版v1.0.3
曼尼汉堡店是一款非常好玩的精品恐怖类型冒险游戏,在这款游戏中
现代总统模拟器去广告版 安卓版v1.0.46
现代总统模拟器是一款休闲养成类游戏,可能对于不少的玩家来说都
现代总统模拟器付费完整版 安卓版v1.0.46
现代总统模拟器高级版在商店是需要付费的,相对于普通版本,高级