Skip to main content
1-Visitor
September 10, 2019
Question

CHANGE IN DATE TIME ZONE IN CSV EXPORT

  • September 10, 2019
  • 2 replies
  • 5555 views

I am facing a problem in the Export file . Where the CSV export file generated from the Query property history service using Export Widget gives DATE TIME in UTC , which is 5:30 Hours behind IST.

When visualized in Mashup by using grid, the DATE & TIME is in IST .

Please find the screenshots for reference.

2 replies

22-Sapphire I
September 10, 2019

All date time is recorded in Thingworx in UTC and then browser side it is converted.

If you need to shift your export time stamp before exporting, you will need to use a service to shift the data according to your time zone.

Anuphd1-VisitorAuthor
1-Visitor
September 11, 2019

Hello PaiChung , 

Can you also please help me with the service or the steps I need to execute for shifting the time. 

 

 

Thanks, 

Anup D

22-Sapphire I
September 11, 2019

You will need to know the time shift, either pre-defined or as a parameter.

After that you can retrieve the raw data and use DeriveFields (from Infotable functions) and the Date Time Functions (in Snippets) to shift the timestamp.

This would be the most efficient, but it will require a bit of a 'hack' (separate wrapping service that only needs the timestamp and has hardcoded time shift or based of a property) because you can't feed two parameters to a function called within DeriveFields

The brute force way otherwise would be to loop through the records.

14-Alexandrite
February 6, 2023

With the new requirement of JVM-Timezone Article - CS331340 - [Important] New Required Timezone setting in ThingWorx 9.x (ptc.com)

Thingworx does not even know it's own timezone ... so you will have to do this with some Java-Extension and a Property storing the timezone of the Server.

There are some basic Timezone services in the BuildingBlock "PTC.Base.TimeZoneHelper_TS" or have a look at the attached java source ...