1

Python Pendulum Mavens,

In Python, when using the [awesome] date & time manipulation package, Pendulum, how can tzinfo (TZ Database Name; such as 'Europe/London', 'Australia/Melbourne', etc.) be determined based on, or as a function of, UTC Offset?

  • For example: Given an Offset of (say) -07:00, how could 'America/Los_Angeles' be derived?

Or, is it necessary to set tz='America/Los_Angeles'?

Many thanks for any assistance!

Plane Wryter
  • 1,299
  • 1
  • 11
  • 14
  • 1
    Possible duplicate of [How to get time zone name from an offset?](https://stackoverflow.com/questions/36629250/how-to-get-time-zone-name-from-an-offset) – Matt Johnson-Pint Apr 30 '19 at 20:51
  • 1
    It is an impossible task. There are 20 different canonical time zones (see [the list here](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)) that have an offset of `-07:00` at one point or another. Please read "Time Zone != Offset" in [the timezone tag wiki](https://stackoverflow.com/tags/timezone/info). Thanks. – Matt Johnson-Pint Apr 30 '19 at 20:55
  • Thanks, Matt! Very informative! – Plane Wryter May 13 '19 at 23:24

0 Answers0