I want to show the milliseconds, but ToString shows the milliseconds as 00000.
I am providing the code below, with the output at each step.
String currentDateTime = DateTime.Now.ToString("G");
Output - 7/27/2011 3:05:31 PM
System.DateTime dateTime = System.DateTime.Parse(currentDateTime);
Output - 7/27/2011 3:05:31 PM
String dateTimeStr = dateTime.ToString("hh.mm.ss.ffffff", "en-US");
Output - 03.05.32.000000
I want to show the output with the milliseconds , eg 03.05.32.33456
If I used ParseExact instead of Parse, I am getting an exception. I know that I can use TryParseExact, but that solution might not be suitable , as I need a generic solution to this problem .
Can someone help me in this.
Thanks in advance. Sujay