def local_tz_info() -> datetime.tzinfo:
    """Get the local time zone object, respects the TZ env variable."""
    timezone = os.environ.get("TZ", None)
    # If timezone is None or an empty string, gettz returns the local time
    tzinfo = tz.gettz(timezone)
    # gettz returns None if the timezone passed to gettz is invalid
    if tzinfo is None:
        raise click.ClickException(
            f"Invalid timezone {timezone} specified, "
            "please set the TZ environment variable with"
            " a valid timezone."
        )
    return tzinfo
Get the local time zone object, respects the TZ env variable.
watson/cli.py