Timezone and current timestamp giving different results in Metabase and Redshift

Hello,

I am using an Amazon Redshift Database.
After trying to solve a problem with date filters on metabase (the one in which today references the day before) I had to switch the Timezone config to "Database Default" and it was solved. I altered the databse timezone to 'America/Sao_Paulo' and metabase filters now recognizes days correctly.

My problem now is that when i execute CURRENT_TIMESTAMP on metabase it gives me the time in UTC rather than on the database timezone.
I am getting this weird result where i get different results from executing the same query on metabase and on Amazon Redshift directly and I don't know how that is possible.

select current_setting('timezone'), sysdate::timestamptz, sysdate::timestamptz at time zone 'utc', sysdate::timestamptz at time zone 'America/Sao_Paulo';

Result on Redshift directly (using dBeaver):

Result on Metabase:

How is this even possible?

My diagnosis info:

{
  "browser-info": {
    "language": "en-US",
    "platform": "Linux x86_64",
    "userAgent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.51 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "1.8.0_312-heroku-b05",
    "java.vendor": "Oracle Corporation",
    "java.vendor.url": "http://java.oracle.com/",
    "java.version": "1.8.0_312-heroku",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "25.312-b05",
    "os.name": "Linux",
    "os.version": "4.4.0-1098-aws",
    "user.language": "en",
    "user.timezone": "Etc/UTC"
  },
  "metabase-info": {
    "databases": [
      "redshift",
      "snowflake"
    ],
    "hosting-env": "heroku",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "13.6 (Ubuntu 13.6-1.pgdg20.04+1)"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.2.23"
      }
    },
    "run-mode": "prod",
    "version": {
      "tag": "v0.41.1",
      "date": "2021-10-21",
      "branch": "release-x.41.x",
      "hash": "76aa4a5"
    },
    "settings": {
      "report-timezone": null
    }
  }
}

Hi @lucascorniani
You should upgrade immediately: https://github.com/metabase/metabase/releases/latest
And then have a look here: https://www.metabase.com/docs/latest/troubleshooting-guide/timezones.html
And you are likely seeing this issue:
https://github.com/metabase/metabase/issues/19910 - upvote by clicking :+1: on the first post

Thank You.
I was able to solve the problem by changing the dimezone in the machine running Metabase.