Time offset in Query

Hi,

Using date filter : I have weird results.
For example : I choose a date filter for 07/07/2020, I have results based on 06/07/2020 and 07/07/2020.

In the query builder, if I have a look at the SQL generated, I have noticed that Metabase is using DateTimeOffsetFromParts with an offset of 2 hours i.e DateTimeOffsetFromParts(2020, 7, 7, 0, 0, 0, 0, 2, 0, 7)

Reason why I have results started on 06/07/2020 10 pm

Database is SQL Server.

How to fiw it ?

Debug info :

{
“browser-info”: {
“language”: “fr”,
“platform”: “Win32”,
“userAgent”: “Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:77.0) Gecko/20100101 Firefox/77.0”,
“vendor”: “”
},
“system-info”: {
“file.encoding”: “Cp1252”,
“java.runtime.name”: “Java™ SE Runtime Environment”,
“java.runtime.version”: “1.8.0_221-b11”,
“java.vendor”: “Oracle Corporation”,
“java.vendor.url”: “http://java.oracle.com/”,
“java.version”: “1.8.0_221”,
“java.vm.name”: “Java HotSpot™ 64-Bit Server VM”,
“java.vm.version”: “25.221-b11”,
“os.name”: “Windows Server 2016”,
“os.version”: “10.0”,
“user.language”: “en”,
“user.timezone”: “Europe/Paris”
},
“metabase-info”: {
“databases”: [
“googleanalytics”,
“postgres”,
“sqlserver”,
“h2”
],
“hosting-env”: “unknown”,
“application-database”: “postgres”,
“application-database-details”: {
“database”: {
“name”: “PostgreSQL”,
“version”: “12.2”
},
“jdbc-driver”: {
“name”: “PostgreSQL JDBC Driver”,
“version”: “42.2.8”
}
},
“run-mode”: “prod”,
“version”: {
“tag”: “v0.35.4”,
“date”: “2020-05-28”,
“branch”: “release-0.35.x”,
“hash”: “b3080fa”
},
“settings”: {
“report-timezone”: “Europe/Brussels”
}
}
}

Hi @nico8
Timezones are really difficult to handle and debug. What is the timezone of your database?
Also have a look at the troubleshooting guide:
https://www.metabase.com/docs/latest/troubleshooting-guide/timezones.html
You might be seeing this issue:
https://github.com/metabase/metabase/issues/10824 - upvote by clicking :+1: on the first post