I store some DateTime in a CSV log with:
DateTime.Now.ToString(\"MM/dd/yyyy hh:mm:ss.fff\")
When I try to read it I found something like:>
use DateTime.ParseExact with specifying the format
String dateStr=DateTime.Now.ToString("MM/dd/yyyy hh:mm:ss.fff"); DateTime date = DateTime.ParseExact(dateStr,"MM/dd/yyyy hh:mm:ss.fff",System.Globalization.CultureInfo.InvariantCulture);