Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
DB2 ISeriesから返されたタイムスタンプをc#のDateTimeデータ型に変換するにはどうすればよいですか?
2012-07-06 09:52:50.926145
これは私にはうまくいきませんでした
myEmployee.LastModified = Convert.ToDateTime(myRecord.GetString(myRecord.GetOrdinal("LASTMODIFIED")));
DateTime.Parse?
DateTime.Parse
DateTime result = DateTime.Parse("2012-07-06 09:52:50.926145");
本当にうまくいきます。
あなたはそれを行うことができますDateTime.TryParse()
DateTime.TryParse()
DateTime date; DateTime.TryParse("2012-07-06 09:52:50.926145", out date);
あなたの場合
DateTime date, DateTime.TryParse(myRecord.GetString(myRecord.GetOrdinal("LASTMODIFIED")), out date);