I am currently looping through a csv file which has numerous dates on various lines, I’ve managed to split and extract what i want however i have a DateTime format issue. Here is my line of code:
current = DateTime.ParseExact(line[0], "dd/MM/yyyy HH:mm:ss.fff", null);
The actual string which is split and read from the csv is:
"20/12/2012 13:08:18.980"
I am calculating the difference between the two DateTimes (in milliseconds). When I’m debugging and looking at the locals this is what appears for the DateTime “current”:
current {20/12/2012 13:08:18} System.DateTime
as you can see it doesn’t give me milliseconds hence my TimeSpan difference calculation gets thwarted.
Please help.
Milliseconds are there. You can verify it using the following code:
When you are looking at variable from debugger, it uses
.ToString()that just does not show milliseconds.