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);
茶杯头甜蜜终章dlc 官方手机版v1.0.0.3
下载火柴人传说暗影格斗内置菜单 最新版v3.0.1
下载荒野乱斗测试服 安卓版v61.10.3
下载荒野乱斗彩虹服 安卓版v61.10.3
下载寒霜启示录 安卓版v1.25.10
寒霜启示录是一款生存模拟游戏,不少玩家可能对于末日都有着自己
末日城堡免广告版 安卓最新版v0.7.1
末日城堡免广告版是一款非常好玩的模拟经营类游戏,内部可以不看
甜蜜人生模拟器 最新版v1.4.5
甜蜜人生模拟器是一款非常好玩的模拟恋爱手游,玩家在这里能够对
武器锻造师内置功能菜单 v10.4
武器锻造师内置菜单版是游戏的破解版本,在该版本中为玩家提供了
开放空间overfield 安卓版v1.0.5
开放空间Overfield是一款箱庭养成经营手游,让你在广阔