TDengine icon indicating copy to clipboard operation
TDengine copied to clipboard

Timezone problem in container

Open bioinformatist opened this issue 3 years ago • 3 comments

In version 3.0.0.1, the default timezone of the taosd by SELECT TIMEZONE(); is Asia/Shanghai.

However, when insert new rocords to database, the timestamp is parsed to Etc/UTC. And if docker exec -it tdengine bash then type timedatectl with the prompt of container, it also told Etc/UTC.

Can you fix it? Thanks in advance.

bioinformatist avatar Aug 30 '22 12:08 bioinformatist

the default value of timezone depends on your host machine's time zone

yu285 avatar Sep 01 '22 06:09 yu285

Well, my host's timezone is Asia/Shanghai so it is indeed same in taosd returned by SELECT TIMEZONE();.

However the timezone of the container is Etc/UTC, and the records inserted are converted to this timezone as well (has 8 hours as difference). Can you reproduce it?

bioinformatist avatar Sep 01 '22 09:09 bioinformatist

For I use TDengine in production, maybe my tone smells a little anxious. I'm sorry for that.

bioinformatist avatar Sep 01 '22 09:09 bioinformatist