DateTime.Parse("")likestring strMyDateTime = "2/16/1992 12:15:12";// myDateTime gets Feburary 16, 1992, 12 hours, 15 min and 12 sec.
System.DateTime myDateTime =
    System.DateTime.Parse(strMyDateTime);

解决方案 »

  1.   

    DateTime.ParseExact 方法将日期和时间的指定字符串表示转换成其等效的 DateTime。该字符串表示形式的格式必须与指定的格式完全匹配。
      

  2.   


    new DateTime(Int64.Parse(PublishDate.Text));
    我这样可不可以?
      

  3.   

    DateTime 构造函数 (Int64)
    [C#]
    public DateTime(
       long ticks
    );
    将 DateTime 结构的新实例初始化为指定的刻度数。当然是可以的。