rt

解决方案 »

  1.   

    time.String("yy-MM-dd HH:mm:ss");
      

  2.   

    string s = " 2007:11:10 12:11:11";
            s = s.Substring(1, 8).Replace(":", "-") + s.Substring(9);
      

  3.   

    time.String("yyyy-MM-dd HH:mm:ss");
      

  4.   

    string str = DateTime.ParseExact("2007:11:10 12:11:11", "yyyy:MM:dd HH:mm:ss", null).ToString("yyyy-MM-dd HH:mm:ss ");
      

  5.   

    string str = DateTime.ParseExact("2007:11:10 12:11:11", "yyyy:MM:dd HH:mm:ss", null).ToString("yyyy-MM-dd HH:mm:ss ");
      

  6.   

    最近一个多月在学习正则,看到这个就犯病    strTest = Regex.Replace(strTest, @":(?=.*\s.*)", "-", RegexOptions.IgnoreCase);