danca
May 16, 2023, 7:28pm
#1
I found some issues while aggregating my data and I came up whit this simple Query where I see metabase is changing the time but only for the most recent month.
The example Query is the following:
SELECT shop_id, date_trunc('month', shop_added) as mes, shop_added
FROM shops
And this is the output.
The expected result for the first 3 rows is May 1, 2023, 00:00 but I'm getting April 30, 2023, 23:00
Luiggi
May 16, 2023, 9:31pm
#2
What’s your instance time zone?
danca
May 17, 2023, 2:06pm
#3
My DB is in UTC and Metabase setting transforms everything to America/Mexico City. (-6 Hrs Difference)
Luiggi
May 17, 2023, 2:47pm
#4
please post diagnostic info, have you checked our troubleshooting guide about timezones?
danca
May 17, 2023, 10:17pm
#5
Luiggi:
diagnostic info
Here is the Diagnostic info
{
"browser-info": {
"language": "es-ES",
"platform": "MacIntel",
"userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
"vendor": "Google Inc."
},
"system-info": {
"file.encoding": "UTF-8",
"java.runtime.name": "OpenJDK Runtime Environment",
"java.runtime.version": "11.0.19+7",
"java.vendor": "Eclipse Adoptium",
"java.vendor.url": "https://adoptium.net/",
"java.version": "11.0.19",
"java.vm.name": "OpenJDK 64-Bit Server VM",
"java.vm.version": "11.0.19+7",
"os.name": "Linux",
"os.version": "5.4.209-116.363.amzn2.x86_64",
"user.language": "en",
"user.timezone": "GMT"
},
"metabase-info": {
"databases": [
"postgres",
"googleanalytics",
"bigquery-cloud-sdk"
],
"hosting-env": "unknown",
"application-database": "postgres",
"application-database-details": {
"database": {
"name": "PostgreSQL",
"version": "14.2"
},
"jdbc-driver": {
"name": "PostgreSQL JDBC Driver",
"version": "42.5.1"
}
},
"run-mode": "prod",
"version": {
"date": "2023-04-28",
"tag": "v0.46.2",
"branch": "release-x.46.x",
"hash": "8967c94"
},
"settings": {
"report-timezone": "America/Mexico_City"
}
}
}
The thing that is the most weird for me is that in the first picture I share the "mes" column is only modified when "shop added column is MAY and for April dates the date_trunc is giving me the right date