在线等,关于两个时间相加问题 我想得到的是两个时间相加后的时间:例如: System.DateTime.Now + "1000-01-01 02:00:00 " 得到他们想加后的一个时间! 怎么得到呢? 希望大家帮忙解答! 谢谢, 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 你的意思是怎么加?分解开了你想怎么加就怎么加for example:string str="1000-01-01 02:00:00 ";string[] strs=str.Split(' ');string[] strDate=strs[0].Split('-');string[] strTime=strs[1].Split(':');...... 分解开了以后,两个都是字符串,str[0]=1000-01-01 str[1]= 02:00:00 怎么把这个数值加到 "2006-01-01 08:00:00"上 啊 先统一格式DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")在split,最后想加 DateTime current=DateTime.Now; DateTime another=Convert.ToDateTime("1000-01-01 02:00:00"); System.TimeSpan timeSpan=new TimeSpan(another.Ticks); current=current.Add(timeSpan);我认为比较简单的办法。 TcpClient 使用代理? DataGridView 如何刷新窗口或者窗口中的控件? 如何用程序自动调用MyIE打开指定地址?顶者有分 cannot start debugging.unable to find microsoft internet explorer. 不知道这个界面是怎么做出来的 socket匪夷所思啊 新手求指教 关于Jmail组件 如何调用IE中的打印预览及打印? 正在进行的方法异常,如何让它返回初始状态。 在c#中如何遍历得到menustrip菜单的所有菜单项 如何更快的截取http内容?
分解开了
你想怎么加就怎么加
for example:
string str="1000-01-01 02:00:00 ";
string[] strs=str.Split(' ');
string[] strDate=strs[0].Split('-');
string[] strTime=strs[1].Split(':');
......
str[0]=1000-01-01
str[1]= 02:00:00 怎么把这个数值加到 "2006-01-01 08:00:00"上 啊
DateTime.Now.ToString("yyyy-MM-dd hh:mm:ss")
在split,最后想加
DateTime another=Convert.ToDateTime("1000-01-01 02:00:00");
System.TimeSpan timeSpan=new TimeSpan(another.Ticks);
current=current.Add(timeSpan);我认为比较简单的办法。