cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Need to share some code when posting a question or reply? Make sure to use the "Insert code sample" menu option. Learn more! X

Timestamps in Mashup PDF Extension

Ascherer17
14-Alexandrite

Timestamps in Mashup PDF Extension

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.

1 ACCEPTED SOLUTION

Accepted Solutions
Ascherer17
14-Alexandrite
(To:PaiChung)

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.

View solution in original post

2 REPLIES 2
PaiChung
22-Sapphire I
(To:Ascherer17)

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

 

Ascherer17
14-Alexandrite
(To:PaiChung)

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.

Top Tags