C# 时间解析的问题 日期时间 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 public DateTime Todate(string str_date) { string[] str = str_date.Split(' '); System.Globalization.DateTimeFormatInfo Dateformat = new System.Globalization.DateTimeFormatInfo(); Dateformat.LongDatePattern = "dd MMMM yyyy"; DateTime Dtime = DateTime.Parse(string.Format("{0} {1} {2} {3}", str[3], str[2], str[1], str[4]), Dateformat); //MessageBox.Show(Dtime.ToString()); return Dtime; } DateTime.Parse就可直接将前面的时间转化为通用时间格式:DateTime.Parse("Wed, 14 Aug 2013 20:48:44").ToString()---〉“2013/8/24 20:48:44” 以Tue, 08 Oct 2013 08:39:26 -0700 (PDT)为例说明Tue, 08 Oct 2013 08:39:26是时间信息,#3楼已经给出转换时间的函数了-0700表示时区信息,前面的负号表示西区,而北京时间是东区相当于+0800Tue, 08 Oct 2013 08:39:26 -0700 (PDT)转换成北京时间相当于+15小时,即Tue, 08 Oct 2013 23:39:26 checkbox控件的 checkstate 属性如何赋值呀? 怎样用代码将1个panel强制置于顶层显示? .net (C#) DATAGRIL 里面按钮加提示 出现错误,不会了,请高手指教 c#读取/写入文件 [200分]C#做安装程序部署时,如何实现注册! 请高手指点! 怪事了,手工行,用openfiledialog就不行了 高手请看一看!! 请问如何试用XML通过MessageQueue传递一个结构 一个简单问题大家给看看,马上结贴! 请教,C#读取FTP文件问题 WPF TreeView 样式
{
string[] str = str_date.Split(' ');
System.Globalization.DateTimeFormatInfo Dateformat = new System.Globalization.DateTimeFormatInfo();
Dateformat.LongDatePattern = "dd MMMM yyyy";
DateTime Dtime = DateTime.Parse(string.Format("{0} {1} {2} {3}", str[3], str[2], str[1], str[4]), Dateformat);
//MessageBox.Show(Dtime.ToString());
return Dtime;
}
DateTime.Parse("Wed, 14 Aug 2013 20:48:44").ToString()---〉“2013/8/24 20:48:44”
Tue, 08 Oct 2013 08:39:26是时间信息,#3楼已经给出转换时间的函数了
-0700表示时区信息,前面的负号表示西区,而北京时间是东区相当于+0800
Tue, 08 Oct 2013 08:39:26 -0700 (PDT)转换成北京时间相当于+15小时,
即Tue, 08 Oct 2013 23:39:26