Debian 8 / 9 Set TimeZone

Debian 8 Set TimeZone +8

1
2
echo "Asia/Shanghai" > /etc/timezone
dpkg-reconfigure -f noninteractive tzdata

Debian 9 Set TimeZone +8

ln -fs /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
dpkg-reconfigure -f noninteractive tzdata

在Dockerfile中配置时区(Debian8)

1
2
RUN echo "Asia/Shanghai" > /etc/timezone
RUN dpkg-reconfigure -f noninteractive tzdata

在MySQL JDBC 8中设置时区

1
serverTimezone=GMT%2B8

REF

CHANGING THE TIMEZONE IN DEBIAN 9 (STRETCH)
Docker 中如何设置 container 的时区
JDBC连接数据库 mysql serverTimezone useSSL 时差