在clojure REPL上对postgres数据库运行查询时,时间戳字段以UTC格式显示,我需要它们位于美国/圣保罗时区(UTC-3)
到目前为止,我已经在Intellij的REPL上尝试了以下几点:
-Duser.timezone=America/Sao_Paulo中设置idea.vmoptions (Intellij):jvm-opts ["-Duser.timezone=America/Sao_Paulo"]添加到project.clj-Duser.timezone=America/Sao_PauloJAVA_OPTS="-Duser.timezone=America/Sao_Paulo:$JAVA_OPTS"在~/.zshrc中关于Leiningen REPL的如下内容:
:jvm-opts ["-Duser.timezone=America/Sao_Paulo"]添加到project.cljJAVA_OPTS="-Duser.timezone=America/Sao_Paulo:$JAVA_OPTS"在~/.zshrc中到目前为止都没有用!
样本代码
(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"])https://stackoverflow.com/questions/62606347
复制相似问题