201112180659 ,这样的日期格式如何转换 转换成 2011-12-18 06:59 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string str = "201112180659"; if (str.Length >= 12) { string sNew = str.Substring(0, 4) + "-" + str.Substring(4, 2) + "-" + str.Substring(6, 2) + " " + str.Substring(8, 2) + ":" + str.Substring(10, 2); DateTime date = Convert.ToDateTime(sNew); }sNew为“2011-12-18 06:59”字符串变量date为2011-12-18 06:59日期型变量 void Main(){ Console.WriteLine(DateTime.ParseExact("201112180659","yyyyMMddHHmm",null).ToString("yyyy-MM-dd HH:mm")); //2011-12-18 06:59} 读取CAD文件信息 怎么实现网页按钮自动点击 双缓冲问题+数据库并发访问问题 网页游戏开发都需要哪些技术?? winform中直接修改datagrid显示数据后如何更新数据库的数据 启动一个C# p2p新项目,找志同者共创 这是什么问题? 为什么这两类编译不过 请教.net安装问题 编写如下代码在菜单项中,编译时系统提示错误: C#入门那本书最好 新手弱弱的问下,public static 和单单static的区别
string str = "201112180659";
if (str.Length >= 12)
{
string sNew = str.Substring(0, 4) + "-" + str.Substring(4, 2) + "-" + str.Substring(6, 2) + " " + str.Substring(8, 2) + ":" + str.Substring(10, 2); DateTime date = Convert.ToDateTime(sNew);
}
sNew为“2011-12-18 06:59”字符串变量
date为2011-12-18 06:59日期型变量
void Main()
{
Console.WriteLine(DateTime.ParseExact("201112180659","yyyyMMddHHmm",null).ToString("yyyy-MM-dd HH:mm"));
//2011-12-18 06:59
}