[Python] Get the canonical timezone name of a backward linked timezone in python?

Discussão em 'Python' iniciado por Stack, Maio 13, 2025.

  1. Stack

    Stack Membro Participativo

    As title said, I'm looking for a simple way to get the canonical name of a timezone when providing a timezone name.

    For example Asia/Calcutta is the backward liked name of Asia/Kolkata.

    I'd expect ZoneInfo("Asia/Calcutta").key to be Asia/Kolkata, but it's not the case and ZoneInfo doesn't have any apparent way to follow link of get the canonical name.

    Is there any way to get this information? Either in ZoneInfo or directly in tzdata?

    Continue reading...

Compartilhe esta Página