def knx_to_datetime(knxdata):
    """Convert a an 8 byte KNX time and date object to its components"""

    if len(knxdata) != 8:
        raise KNXException("Can only convert an 8 Byte object to datetime")

    year = knxdata[0] + 1900
    month = knxdata[1]
    day = knxdata[2]
    hour = knxdata[3] & 0x1f
    minute = knxdata[4]
    second = knxdata[5]

    return datetime(year, month, day, hour, minute, second)
def knx_to_datetime ( knxdata ) : if len ( knxdata ) != 8 : raise KNXException ( "Can only convert an 8 Byte object to datetime" ) year = knxdata [ 0 ] + 1900 month = knxdata [ 1 ] day = knxdata [ 2 ] hour = knxdata [ 3 ] & 0x1f minute = knxdata [ 4 ] second = knxdata [ 5 ] return datetime ( year , month , day , hour , minute , second )
Convert a an 8 byte KNX time and date object to its components