regebro / tzlocal

A Python module that tries to figure out what your local timezone is
MIT License
184 stars 58 forks source link

In unix , when '/etc/timezone' and '/etc/localtime' timezone is difference, will bring an error #67

Closed itaa closed 5 years ago

itaa commented 5 years ago

In unix , when '/etc/timezone' and '/etc/localtime' timezone is difference, will bring an error .

In python 'datatime' module use '/etc/localtime' confirm timezone,but 'tzlocal' use '/etc/timezone' first.

Our common use modify '/etc/localtime' to change timezone, so I suggest 'tzlocal' also use '/etc/timezone' first.

regebro commented 5 years ago

If you have an inconsistent configuration, that's a configuration error, and needs to be fixed on your side.

If you have a /etc/timezone, it must agree with /etc/localtime, or your computer is simply misconfigured. Any software that wants to know the name of your time zone will then get the wrong name. Either update /etc/timezone, or delete it.