Skip to main content
Ascherer17
16-Pearl
June 27, 2018
Solved

Timestamps in Mashup PDF Extension

  • June 27, 2018
  • 2 replies
  • 1821 views

I'm using the PDF Extension to create a pdf of a time series chart.  I have the mashup set to query some data and display it in the Time Series Chart widget.  Everything works great except that the timestamps on the chart are 5 hours ahead of the expected timestamps. 

Looking up UTC time, my time zone is 5 hours behind UTC.  I understand that Thingworx stores timestamps as UTC and then shows them in the client's time zone context when data is queried.  It appears that the PDF extension uses UTC time since it is a headless renderer of the mashup.  

 

Anybody have an idea of how I can get the extension to show times in a specific time zone context rather than UTC?  Adding a time zone input to the CreatePDF Service of the extension seems like a good idea for cases like this.  

Of course, I could add services that process the data to change timestamps based on the time zone I want to show, but I'd like to know if anyone has some other insight.

This topic has been closed for replies.
Best answer by Ascherer17

I ended up using the TimeShift() function on the InfoTable before it goes into the Time Series Chart. In order to get the correct UTC offset, I used the dateOffset() snippet.

2 replies

22-Sapphire I
June 27, 2018

I don't think there is any utility out there at the moment, so you will need to do the conversion unfortunately.

 

Ascherer17
Ascherer1716-PearlAuthorAnswer
16-Pearl
September 13, 2018

I ended up using the TimeShift() function on the InfoTable before it goes into the Time Series Chart. In order to get the correct UTC offset, I used the dateOffset() snippet.