我有一个日期时间格式为“20/6/2014 12:45:00 PM”,我希望将其转换为我的SQL日期时间格式,例如:“2013-06-01 12:38:28.000 “C#中的日期时间转换#
DateTime date = DateTime.ParseExact("20/6/2014 12:45:00 PM", "dd/MM/yyyy HH:mm:ss", System.Globalization.CultureInfo.InvariantCulture);
试过以上但它不起作用。错误 - 字符串未被识别为有效的日期时间。
[给定DateTime对象,如何获得字符串格式的ISO 8601日期?](http://stackoverflow.com/questions/114983/given-a-datetime-object-how-do- i-get-a-iso-8601-date-in-string-format) – Tanner
原始值是一个字符串还是已经是日期时间? – Steve