先顶之

解决方案 »

  1.   

    只要可以运行 立即揭贴 期待ING
      

  2.   


    class Program
        {
            static void Main(string[] args)
            {
                string myDateTimeValue1 = "4/8/2008 0:00:34";
                string myDateTimeValue2 = "4/8/2008 0:14:54";
                DateTime time1 = DateTime.Parse(myDateTimeValue1);
                DateTime time2 = DateTime.Parse(myDateTimeValue2);
                TimeSpan time3 = time2 - time1;
                Console.Write("{0}",time3.ToString());
                Console.ReadLine();
            }
        }
      

  3.   

    如果要是算 不在一天里的时间差 你那么写肯定有毛病 不过根据你的思路 我确实 把扣 解了 谢谢 马上给分另附上代码做参详            string myDateTimeValue1 = "2008-8-3 0:00:34";
                string myDateTimeValue2 = "2008-8-4 0:20:34";
                DateTime time1 = DateTime.Parse(myDateTimeValue1);
                DateTime time2 = DateTime.Parse(myDateTimeValue2);
                TimeSpan time3 = time2 - time1;
                Response.Write(time3.TotalMinutes.ToString());
      

  4.   

    晕了,没仔细看,代码没错,我刚才把myDateTimeValue1 = "4/8/2008 0:00:34"里面的的3写成4了,
      

  5.   

    加个QQ好友啊,一起交流,CSDN老早就注册了,一直潜水!:)