Newman HTML report with hbs to show time zone

Hi

I am using htmlextra report with .hbs template to create a dashboard of test execution using newman and postman collection. The sample hbs file was shared by @danny-dainton. I have customized it according to our requirement.

It is working fine. No issues. The time is displayed as below. I would like to show this time with timezone. Examples: PDT America/Los_Angeles and Indian Standard time.

I tried adding “ZZ” to moment date. It shows UTC time as “Thursday, 23 May 2019 14:53:59 -0700”. [

{{moment date format=“dddd, DD MMMM YYYY HH:mm:ss ZZ”}}

]

Should I write JS function to get the date and time with time zone? OR is there a simple way to show the time in specific zone like PDT zone?

Thursday, 23 May 2019 14:53:59

Here is the snippet from hbs file.

"

Dashboard

{{moment date format="dddd, DD MMMM YYYY HH:mm:ss "}}

"

How this is executed: newman run collections/QE_tests.json -e collections/env.json -r htmlextra --reporter-htmlextra-export statusdashboard.html --reporter-htmlextra-template test.hbs

Thanks, rjayaram

Hey @rjayaram

The helper-moment module that’s being use to create that timestamp doesn’t support timezones. This is an issue that has been raised on that project from another user.

I’ll take a look at trying to get that support into the reporter but for now, with the current code, it’s not possible.

OK @danny-dainton. Thanks for the update. I managed it by using zone option to show UTC offset and provided a label specifying the name of the time zone.