Difference Between Now() in Lokkml and Now() in table Calculations

Hi Lookers

I have encountered a discrepancy between the Reported Date-time from the function now() when used inside LookML and the same function when used from the Table Calculation.

  • The SQL data base connected to looker is UTC , which report the same as LookML
  • The LooKer Application Time Zone is set to Africa-Egypt, Which report the same as Table calculation and the Local Machine.

I need LookML to report the same time as the Local machine [Which is UTC+2]

Appreciate your help as this creates a discrepancy in many of my reports.

0 8 9,033
8 REPLIES 8

Dawid
Participant V

In table calculations it will be application timezone if no specific settings are used, and it will be evaluated once the query is returned.

So even if you had the same timezone in both I would still expect the discrepancy, You’d need to change application timezone to UTC if you wanted the same or use some kind of offset in the table calculation.

Or, perhaps you could use convert_tz: yes in your metrics: https://docs.looker.com/reference/field-params/convert_tz

Hi Dawid

Hope you have a good day, and thanks for your response.

I want all calculations of Now() is to be in local time zone
But now the LookML calculates Now() as UTC like the database settings.
😔

Dawid
Participant V

What happens if you create a dimension in LookML and include convert_tz: yes, can you check?

I am afraid it didn’t work either , I don’t understand why? 😬 😬 😬
image

image

But it works well in table calculation !

While Looker Settings is as below:
image
And
image

Dawid
Participant V

Can you try convert_tz with a dimension? I think it doesn’t work with measures

I am afraid it gives the same values (UTC) , it never converts to the Local Time (GMT+2)

@Dawid

Hi Dawid
I believe I’ve Just found a workaround 😀
image

This will help me to get my calculation correct for this business case, If I am going to deal with different time Zones in the future, I Believe i will use Liquid parameter in filling the Now() measure.

Thanks a lot for your assist and time.

Been a long time this was posted but you can try enabling User Specific Time Zones and set your timezone on your Account page to the same as the Application Timezone Setting.

Top Labels in this Space
Top Solution Authors