1. Help Center
  2. FAQ
  3. Visualization Support

Timezone Conversion in Growth

An explanation on timezone conversion and what that Time Zone drop down does in the Daasity app

Timezone conversions are handled in the Daasity transformation code.  All raw data is stored in UTC and when your transformation code is run it uses the timezone that you selected in the Daasity app to convert data into your preferred timezone.

When viewing data in the Daasity app you may notice a Time Zone drop down in the upper right hand corner:

This drop down ONLY controls any "complete day" filters that are placed in the dashboard or explore filter.  For instance, if that Time Zone in the Daasity app is set to "America - Los Angeles", then the "Order Date is in the past 30 complete days" filter will select data through midnight PST.  If the Time Zone in the Daasity app is set to "America - New York" then the filter will select data through midnight EST.

The actual SQL code that gets generated looks like this:

WHERE ((( sales_report.TRANSACTION_DATE ) >= ((DATEADD('day', -30, DATE_TRUNC('day', CONVERT_TIMEZONE('UTC', 'America/Los_Angeles', CAST(CURRENT_TIMESTAMP() AS TIMESTAMP_NTZ)))))) AND ( sales_report.TRANSACTION_DATE ) < ((DATEADD('day', 30, DATEADD('day', -30, DATE_TRUNC('day', CONVERT_TIMEZONE('UTC', 'America/Los_Angeles', CAST(CURRENT_TIMESTAMP() AS TIMESTAMP_NTZ))))))))) 

Notice that the timezone conversion function is ONLY getting applied to the "CURRENT_TIMESTAMP" piece of the code.  In other words, changing that timezone drop down only changes the time that begins and ends a day for purposes of determining if an order falls in the "last 30 complete days" by changing the hour where the day actually begins and ends. 

IF THAT IS TRUE THEN WHY DON'T MY RESULTS CHANGE WHEN I CHANGE THE FILTER?

The data will change if you select a timezone that is, at that moment, in a different day than you.  

As an example, this SQL code:

( sales_report.TRANSACTION_DATE ) < ((DATEADD('day', 30, DATEADD('day', -30, DATE_TRUNC('day', CONVERT_TIMEZONE('UTC', 'America/Los_Angeles', CAST(CURRENT_TIMESTAMP() AS TIMESTAMP_NTZ))))))))) 

tells Looker to find all transaction dates that are less than the current day.  The timezone conversion piece determines what exactly is the current day.  If you set the timezone to a timezone where the current day is tomorrow or yesterday, then your results will change.