How to change the time format in Extent report 3.0.2 for c#

1.1k Views Asked by At

I am trying to change format of time displayed in extent report for C#. Currently its displaying as "07/09/2017 10:59:58". so is it possible to change these format in any other format?

2

There are 2 best solutions below

1
On BEST ANSWER

This is not currently possible in version 3 of ExtentReports.NET. However, you can open an enhancement request for future versions.

1
On

Yes you can do it like this .

DateTime dt = DateTime.ParseExact(yourObject.ToString(), "MM/dd/yyyy hh:mm:ss tt", CultureInfo.InvariantCulture);

string s = dt.ToString("dd/M/yyyy", CultureInfo.InvariantCulture);