Forum Discussion

R1's avatar
R1
7 - Data Storage
01-05-2023

Convert timestamp from the data model to a different timezone based on the dashboard filter

harikm007 

Hi,

My use-case detail: We have a table in our data model with "updated timestamp" column in GMT timezone and another column which has the country name. This country name is one of our dashboard filters. The requirement is to convert the "updated timestamp" from the table into the timezone of the country selected i the dashboard filter and display it in the blox widget. Snapshot of the table with timestamp (GMT) below:

My blox widget currently displays the "updated timestamp" as it is in the table. How is this conversion possible? I could think of three ways.

1. If the conversion is done and stored as a custom table in data model, it can be displayed in the blox widget directly.

2. Fetch the updated timestamp from the datamodel from inside my blox widget's script, convert it into the country's timezone( determined by the dashboard filter) and then display the converted timestamp in my blox wdiget.Is there a way for me to fetch this updated timestamp from the data model from the widget script? 

3. My blox widget currently displays the "updated timestamp" as it is in the table using the 'Items' on the left panel and using it in the code like "text": "{panel:columnName}" . Could this be fetched inside the script, converted to a Date value and then finally convert to the timezone of the country in the filter?

Regards,Ramya