Looker dimension_group with type time is changing my timestamps back a day, why is this happening?

Recently, when I have been using the dimension_group with type time, it has been reverting my dates back a day. For example, in my query I would have a column of dates depicting only the first day of the month. (ex: 2021-03-01, 2021-12-01). But when I input this column into the LookML dimension_group, I start seeing the dates with a day subtracted (ex: 2021-02-28, 2021-11-31). 

Why does this happen? How can I fix this?

Solved Solved
0 3 118
1 ACCEPTED SOLUTION

KAEYV
New Member

Recently, when I have been using the dimension_group with type time, it has been reverting my dates back a day. For example, in my query I would have a column of dates depicting only the first day of the month. (ex: 2021-03-01, 2021-12-01). But when I input this column into the LookML dimension_group, I start seeing the dates with a day subtracted (ex: 2021-02-28, 2021-11-31). 

Why does this happen? How can I fix this?

Hi, You might want to add ‘convert_tz: no’ as a keyword to your dimension definition this should fix it. kr Victor

View solution in original post

3 REPLIES 3

Hi Blee,

It looks like it is a Looker Timezone setting.

Please find the following steps to set the desired timezone output:

1.- Go to Admin section and select “Databases → Connections”

3c14bf04-277a-49a7-a085-d6a4b3a9e934.png

2.- Find the SQL database that your project is using  and click on “Edit” button.

0414effe-066a-40f2-8289-70fe689eafe5.png

3.-  Find the option “Database Timezone” and select the properly timezone.

80df666b-e396-4deb-a31a-9842ea73f2cf.png

4.- Click on “Update connection” button to save all changes.

42c71283-f10c-4968-b71c-09be7a12be31.png

Hope it helps!

Best regards,

Leo

KAEYV
New Member

Recently, when I have been using the dimension_group with type time, it has been reverting my dates back a day. For example, in my query I would have a column of dates depicting only the first day of the month. (ex: 2021-03-01, 2021-12-01). But when I input this column into the LookML dimension_group, I start seeing the dates with a day subtracted (ex: 2021-02-28, 2021-11-31). 

Why does this happen? How can I fix this?

Hi, You might want to add ‘convert_tz: no’ as a keyword to your dimension definition this should fix it. kr Victor

Thank you for the help! I used KAEYV’s solution as I didn’t want to convert timezones of all my data.

Top Labels in this Space
Top Solution Authors