Get the Olson TZ name for the local timezone?

前端 未结 11 1363
孤街浪徒
孤街浪徒 2020-11-30 03:19

How do I get the Olson timezone name (such as Australia/Sydney) corresponding to the value given by C\'s localtime call?

This is the value overridden vi

11条回答
  •  悲哀的现实
    2020-11-30 03:45

    The tzlocal module for Python is aimed at exactly this problem. It produces consistent results under both Linux and Windows, properly converting from Windows time zone ids to Olson using the CLDR mappings.

提交回复
热议问题