How to get timezone from country code in Golang

Iam newbie in Golang. Iam converting a function from PHP to Golang.

I want to get timezone from country code in Golang. It is similar this function in PHP

public static array DateTimeZone::listIdentifiers ([ int $what = DateTimeZone::ALL [, string $country = NULL ]] )
Which function have similar feature in Golang ?

Thanks all.

Just tried googling ‘golang time countrycode’, where the first hit is what appears to be a Stack Overflow post where you have gotten lots of answers :slight_smile:

As the Stack Overflow answers tell you, a country could have lots of timezones, so it is mostly impossible to go from countrycode to a single timezone. You could go from a geographical position such as GPS coordinates to a timezone I guess.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.