Abhilash J A

Abhilash J A

  • 532
  • 2.4k
  • 599k

how to get datetime with milliseconds in c#?

Jun 24 2016 3:01 AM
Sir,<br /><br />I am trying to export excel sheet using C#.net and also need excel sheet name like year with datetime.<br />I have tried below c# code but can not getting date like this, ie;<br /><br />I want output, string strfilename = "<span style="color: #ff0000;">06/24/2016-8:32:45.126 AM</span>";<br /><br /> DateTime filename = DateTime.Now;<br /> string strfilename = filename.ToString("yyyyMMddHHmmss");<br /><br />Kindly replay me.<br /><br />Regards,<br />Abhilash.J.A

Answers (7)