-
Notifications
You must be signed in to change notification settings - Fork 5.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Time zone issues : another use case #5927
Comments
Went through #5902 and the associated writeup on timezone troubleshooting. Seems like the case of "Dates without an explicit time zone are being converted to another day". The suggested solution, to explicitly set the server time zone, does not seem to work. Also realised that not ALL timezone fixes are in 26RC1, so I will wait till the 26 release to test this again. |
@manurana A JVM timezone is always specified. If one is provided via user.timezone, that is used, if not, the system's timezone is used. If you are using a report timezone, the JVM timezone should no longer matter. I think I found a separate issue causing your problems. This code uses a default formatter from Joda Time. This will use UTC and it needs to be aware of the report timezone you have specified. I'll get that fixed. |
Thanks @senior ! I hope the fix is able to solve all 3 of my issues ! And thanks for the clarification on the report timezone vs JVM timezone. Maybe a candidate for the timezone doc ? |
This bug seems like it would cause 1 and 2. I'm not sure about 3. What do you mean that it should consider the 30 minute differences? The "Hour of the Day" bucketing puts things together that occur in the same hour, not the same half hour. Could you elaborate a bit more on what you are looking for here? |
Let me try to clarify what I mean by half hour. If a row/metric has a time of For the report in IST, the All this is pretty straightforward, and I am sure the system takes care of it. I am just trying to explain away the discrepancy between the manual SQL numbers and the report, because they are not aligning. It seems to be just another manifestation of the same bug. |
bumping this since we're in the process of cutting an RC2 for 0.26 and it doesn't seem like we've made enough headway to be sure it'll be fixed in the next day or two. If it is, we'll include it in 0.26. |
We have encountered the similar problem of ignoring +30M in pulses. We are in IRDT (+3.30)(Asia/Tehran). And as we want to send pulses at midnight, it is sent at 00:30. Will it be fixed with the issue addressed above by @manurana, @salsakran or it is a new issue? |
@alirezastack Your issue sounds different than this one. Is the issue that the pulses are sent at the wrong time, or is it at the dates/timestamps in the pulse (the data) are in the wrong timezone? |
@alirezastack what is your server/docker timezone and reporting timezone? |
@salsakran Server is in |
This seems to be a similar issue to #3584, but in that case the issue is with timestamp |
Facing the same issue. Server Timezone: UTC I need a query to find the number of carts which were checked out today. When I set up a Question for the same via GUI, I get the answer as 10. SELECT count(*) AS `count`
FROM `cart`
WHERE ((`cart`.`created_for_testing` = FALSE
AND `cart`.`is_checked_out` = TRUE) AND date(`cart`.`checked_out_on`) = date(now())) On manually adding the convert_tz line, it works perfectly and gives 15 as output. SELECT count(*) AS `count`
FROM `cart`
WHERE ((`cart`.`created_for_testing` = FALSE
AND `cart`.`is_checked_out` = TRUE) AND date(convert_tz(`cart`.`checked_out_on`, 'UTC', 'Asia/Calcutta')) = date(now())) Isn't the Report timezone setting in Admin Panel supposed to add this offset to queries automatically? If that can be done, it will help us a lot - as we can let everyone in the company set up any question they want. If not, they have to depend on dev team to manually repair the SQL queries to get the correct data. Metabase is an amazing tool which has given us an unlimited number of dashboards and queries to use for free, as opposed to other commercial alternatives which have expensive quota limits. But this one drawback is preventing full adoption by our team. Hope to see it fixed soon. |
@manurana I spent some time digging into this problem yesterday and I think I have a pretty good idea of what the problem is, but unfortunately I think it is not an easy fix. The issue is that you are using a This issue here is that you have the knowledge around how that is stored. If Metabase tried to guess what your intent was (UTC vs. Asia/Calcutta) we could be wrong. The real fix is that we need to allow you to tell us how to interpret Another option would be to switch datatypes. I'm not sure how easy this is for you. MySQL has another datatype called |
Hi @senior !
Is this not a very unlikely use case ? I thought (and I might be wrong here) that the whole purpose of having a database in UTC was to make sure that your If we do consider this an outlier use case, then we do have all the information necessary to deal with this data. Any time stored in a UTC DB can be assumed to be in UTC. And the report timezone is what I specify in one/both of metabase UI or JVM settings (I still don't fully understand the interaction between them) The new issue you have created would still be valid for the outlier use case. If we can have a simpler solution to cover the generic use case (where we assume that the |
Metabase 26rc1, running on a EC2 with UTC. I am in IST (+5.30)(Asia/Calcutta). Metabase client is set to use India/Calcutta as the timezone. The mySQL DB is on UTC. Java version is "1.8.0_141"
Time zone on the client is set to Asia/Calcutta
MB is running on the server without a time zone set
nohup java -Xmx1536m -Xms1536m -jar ~/current/metabase.jar &
Running it on the server with the time zone set makes no difference
#nohup java -Xmx1536m -Xms1536m -Duser.timezone=Asia/Calcutta -jar ~/current/metabase.jar &
This is a follow up to #2035
I have created a question which groups a certain metric by the hour of day. The field in question, "Appointment Dt", is a
DATETIME
data type in mySQLThere are 3 issues here
See the following screenshot :
This is the RIGHT query which should execute (which we are currently doing in SQL). I have deliberately used the PREVIOUS date so the figures can be compared for the third part of my question
This is the result of the query
And finally, the query log
The text was updated successfully, but these errors were encountered: