'Update uptime stat using the input method.'

@GlancesPlugin._check_decorator
@GlancesPlugin._log_result_decorator
def update(self):

    self.reset()
    if (self.input_method == 'local'):
        self.uptime = (datetime.now() - datetime.fromtimestamp(psutil.boot_time()))
        self.stats = str(self.uptime).split('.')[0]
    elif (self.input_method == 'snmp'):
        uptime = self.get_stats_snmp(snmp_oid=snmp_oid)['_uptime']
        try:
            self.stats = str(timedelta(seconds=(int(uptime) / 100)))
        except Exception:
            pass
    return self.stats
