When running a query on a postgres database on a clojure REPL, the timestamps fields are presented in UTC and I need them to be in timezone America/Sao_Paulo (UTC-3)
So far I have tried the following on Intellij's REPL:
- Set
-Duser.timezone=America/Sao_Pauloinside the fileidea.vmoptions(intellij's) - Add
:jvm-opts ["-Duser.timezone=America/Sao_Paulo"]to project.clj - Add
-Duser.timezone=America/Sao_Pauloin Intellij's REPL configuration - export
JAVA_OPTS="-Duser.timezone=America/Sao_Paulo:$JAVA_OPTS"inside~/.zshrc
and the following on Leiningen REPL:
- Add
:jvm-opts ["-Duser.timezone=America/Sao_Paulo"]to project.clj - export
JAVA_OPTS="-Duser.timezone=America/Sao_Paulo:$JAVA_OPTS"inside~/.zshrc
None worked so far!
Sample code
(ns experiments
(:require [next.jdbc :as jdbc]))
(def db
{:dbtype "postgres"
:dbname "<dbname>"
:host "<host>"
:port 5432
:user "<user>"
:password "<pass>"})
(def ds (jdbc/get-datasource db))
(jdbc/execute! ds ["select current_timestamp"])