简单的时间运算  比如 12:20+00:20s=12:40   怎么么转化  请指点
           

解决方案 »

  1.   

    DateTime dt=DateTime.parse( 12:20)
    date.Now .AddMinutes (20)
    if(dt=DateTime.parse( 12:40))这样行不?
      

  2.   

    用一个变量存储你的本地时间string strDate=DateTime.Now.Year.ToString()+DateTime.Now.Month.ToString()+DateTime.Now.Day.ToString()+DateTime.Now.Hour+ToString(); 然后把你在数据库里的时间取出来 
    最后还剩下多少时间=数据库的时间-Convert.Int32(strDate);
      

  3.   

    用一个变量存储你的本地时间string strDate=DateTime.Now.Year.ToString()+DateTime.Now.Month.ToString()+DateTime.Now.Day.ToString()+DateTime.Now.Hour+ToString(); 然后把你在数据库里的时间取出来 
    最后还剩下多少时间=数据库的时间-Convert.Int32(strDate);
      

  4.   

    最后强制转换.
    DateTime(dr["EndTime"])