Mariusz
Mariusz

Reputation: 2737

"ValueError: Timezone offset does not match system offset: 28800 != 7200. Please, check your config files."

I just got the error from the subject of this question, when running a python app on a cloud server (Alibaba Cloud). Any idea how to solve it on Ubuntu?

Upvotes: -2

Views: 6449

Answers (3)

guanguanjujiu
guanguanjujiu

Reputation: 1

I once solved this problem in docker

ENV TZ=Asia/Shanghai
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
ENV LANG=en_US.UTF-8
ENV LC_ALL=en_US.UTF-8
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone
RUN ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
RUN echo 'Asia/Shanghai' >/etc/timezone

Upvotes: 0

C. Bess
C. Bess

Reputation: 617

You could also set the timezone information for the specific user: edit .bashrc to add a line like:

export TZ="/usr/share/zoneinfo/America/Chicago"

More details: https://www.cyberciti.biz/faq/howto-linux-set-time-zone-per-user-basis/

Upvotes: 2

Mariusz
Mariusz

Reputation: 2737

ok, i found it:

sudo dpkg-reconfigure tzdata

Upvotes: 7

Related Questions