30Дек/090
String to DateTime DateTime to String
.NET Framework, C#
String to DateTime
// String to DateTime String MyString; MyString = "1999-09-01 21:34 PM"; //MyString = "1999-09-01 21:34 p.m."; //Depends on your regional settings DateTime MyDateTime; MyDateTime = new DateTime(); MyDateTime = DateTime.ParseExact(MyString, "yyyy-MM-dd HH:mm tt", null);
DateTime to String
//DateTime to String MyDateTime = new DateTime(1999, 09, 01, 21, 34, 00); String MyString; MyString = MyDateTime.ToString("yyyy-MM-dd HH:mm tt");