我有這個String
:字符串爲datetime異常
05/09/2013 23:23
,我想它這個轉換爲DateTime
:
DateTime alarmDateTime = new DateTime();
alarmDateTime = DateTime.ParseExact(date, "MM/dd/YYYY HH:mm", null);
,我得到這個異常:
String was not recognized as a valid DateTime.
任何想法爲什麼會發生?
是什麼:'YYYYY'?你的意思是'yyyy'嗎? – Silvermind 2013-05-01 12:29:58