TuGraph-family / tugraph-db

TuGraph: A High Performance Graph Database.
https://tugraph.org
Apache License 2.0
1.43k stars 191 forks source link

请教docker启动的如何修改查询语句显示的时间/时区 #691

Closed lambda-zhang closed 4 weeks ago

lambda-zhang commented 1 month ago

Environment:

Describe the bug

默认启动的容器内部时区不对,把容器内部时间该对之后,页面上查询的时间还是不对

How to reproduce and expected behavior

docker启动

docker run -d --name tugraph_demo \
                -e TZ="Asia/Shanghai" \
        -v $(pwd)/data:/var/lib/lgraph/data \
        -v $(pwd)/log:/var/log/lgraph_log \
        -p 7070:7070  \
        -p 7687:7687 \
        -p 9090:9090 \
                tugraph/tugraph-mini-runtime-ubuntu18.04:4.5.0 lgraph_server

启动之后查看时间,发现和显示时间查8个小时(实际应该是Tue, 08 Oct 2024 20:48:53)

$ docker exec -it tugraph_demo /bin/bash
# date -R
Tue, 08 Oct 2024 12:48:53 +0000

在容器内部安装tzdata, 命令行看到时间对了

# apt-get update
# apt-get update tzdata
# date -R
Tue, 08 Oct 2024 21:20:10 +0800

重启容器

$ docker stop tugraph_demo
$ docker start tugraph_demo

再进入容器内部看时区是对的,在网页上查询

return datetime()

返回的结果

2024-10-08 13:20:41.711771000

还是差8个小时

ljcui commented 1 month ago

后续的版本修复