HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //snap/certbot/4965/lib64/python3.12/site-packages/pyrfc3339/utils.py
def format_timezone(utcoffset):
    """
    Return a string representing the timezone offset.
    Remaining seconds are rounded to the nearest minute.

    >>> format_timezone(3600)
    '+01:00'
    >>> format_timezone(5400)
    '+01:30'
    >>> format_timezone(-28800)
    '-08:00'

    """

    hours, seconds = divmod(abs(utcoffset), 3600)
    minutes = round(float(seconds) / 60)

    if utcoffset >= 0:
        sign = "+"
    else:
        sign = "-"
    return "{0}{1:02d}:{2:02d}".format(sign, int(hours), int(minutes))