(tzid, smart=True)
return tz
Return the tzid if it exists, or None.
Return the tzid if it exists, or None.
Return the tzid if it exists or None .
def getTzid(tzid, smart=True):
    """
    Return the tzid if it exists, or None.
    """
    tz = __tzidMap.get(toUnicode(tzid), None)
    if smart and tzid and not tz:
        try:
            from pytz import timezone, UnknownTimeZoneError
            try:
                tz = timezone(tzid)
                registerTzid(toUnicode(tzid), tz)
            except UnknownTimeZoneError as e:
                logging.error(e)
        except ImportError as e:
            logging.error(e)
    return tz
def getTzid ( tzid , smart = True ) : tz = __tzidMap . get ( toUnicode ( tzid ) , None ) if smart and tzid and not tz : try : from pytz import timezone , UnknownTimeZoneError try : tz = timezone ( tzid ) registerTzid ( toUnicode ( tzid ) , tz ) except UnknownTimeZoneError as e : logging . error ( e ) except ImportError as e : logging . error ( e ) return tz