How do I convert a timestamp returned from DB2 ISeries to DateTime datatype in c#?
2012-07-06 09:52:50.926145
This did not worked for me
myEmployee.LastModified = Convert.ToDateTime(myRecord.GetString(myRecord.GetOrdinal("LASTMODIFIED")));
You can do it with DateTime.TryParse()
DateTime date;
DateTime.TryParse("2012-07-06 09:52:50.926145", out date);
In your case
DateTime date,
DateTime.TryParse(myRecord.GetString(myRecord.GetOrdinal("LASTMODIFIED")), out date);
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.