def getTime(self):
    """Get the RTC time.  Returns a datetime object, or NULL if the clock is not set"""
    command = '$GT'
    time = self.sendCommand(command)
    if time == ['OK','165', '165', '165', '165', '165', '85']:
      return NULL
    else:
      return datetime.datetime(year = int(time[1])+2000,
                               month = int(time[2]),
                               day = int(time[3]),
                               hour = int(time[4]),
                               minute = int(time[5]),
                               second = int(time[6]))
def getTime ( self ) : command = '$GT' time = self . sendCommand ( command ) if time == [ 'OK' , '165' , '165' , '165' , '165' , '165' , '85' ] : return NULL else : return datetime . datetime ( year = int ( time [ 1 ] ) + 2000 , month = int ( time [ 2 ] ) , day = int ( time [ 3 ] ) , hour = int ( time [ 4 ] ) , minute = int ( time [ 5 ] ) , second = int ( time [ 6 ] ) )
Get the RTC time.  Returns a datetime object, or NULL if the clock is not set