Set the current value to the correct tuple based on the seconds
        since the epoch.  If 'when' is not provided, get the current time
        from the task manager.
769796
def now(self, when=None):
        
        if when is None:
            when = _TaskManager().get_time()
        tup = time.localtime(when)

        self.value = (tup[0]-1900, tup[1], tup[2], tup[6] + 1)

        return self
114451
def update_current_time(loop):
    
    global current_time
    current_time = time()
    loop.call_later(1, partial(update_current_time, loop))
1207534
def set_time(self, time):
        '''
        
        '''
        times = num2date(time[:].squeeze(), time.units)
        self.time = pd.DatetimeIndex(pd.Series(times), tz=self.location.tz)
493865
def at_time(self, time, nearest_sample=False):
        
        if nearest_sample:
            time += self.delta_t / 2.0
        return self[int((time-self.start_time)*self.sample_rate)]
1124626
def set(self, time, value, compact=False):
        
        if (len(self) == 0) or (not compact) or \
                (compact and self.get(time) != value):
            self._d[time] = value
557613
def setcreated(self, dt=None):
        
        if dt is None:
            self.created = Token.utc()
        else:
            self.created = dt
1287352
def utcfromtimestamp(cls, t):
        ""
        t, frac = divmod(t, 1.0)
        us = int(frac * 1e6)

        # If timestamp is less than one microsecond smaller than a
        # full second, us can be rounded up to 1000000.  In this case,
        # roll over to seconds, otherwise, ValueError is raised
        # by the constructor.
        if us == 1000000:
            t += 1
            us = 0
        y, m, d, hh, mm, ss, weekday, jday, dst = _time.gmtime(t)
        ss = min(ss, 59)    # clamp out leap seconds if the platform has them
        return cls(y, m, d, hh, mm, ss, us)
312017
def unix_time(self, dt):
        
        epoch = datetime.utcfromtimestamp(0)
        delta = dt - epoch
        return int(delta.total_seconds())
1151854
async def setex(self, name, time, value):
        
        if isinstance(time, datetime.timedelta):
            time = time.seconds + time.days * 24 * 3600
        return await self.execute_command('SETEX', name, time, value)
1205256
def last_update_time(self, value):
        
        if isinstance(value, (datetime.datetime,)):
            self._last_update_time = value
        else:
            raise ValueError("Expect last_update_time to be a datetime")
488636
def now(self):
		
		if self.use_utc:
			return datetime.datetime.utcnow()
		else:
			return datetime.datetime.now()
639021
def stopwatch_now():
    
    if six.PY2:
        now = time.time()
    else:
        now = time.monotonic()
    return now
1062752
def valueFromString(self, value, context=None):
        
        if value in ('today', 'now'):
            return datetime.date.utcnow()

        try:
            return datetime.datetime.fromtimestamp(float(value))
        except StandardError:
            if dateutil_parser:
                return dateutil_parser.parse(value)
            else:
                return datetime.datetime.min()
601783
def convert_timeval(seconds_since_epoch):
    """"""
    frac, whole = math.modf(seconds_since_epoch)
    microseconds = math.floor(frac * 1000000)
    seconds = math.floor(whole)
    return seconds, microseconds
839776
def setTime(self, time):
        
        hour = time.hour()
        minute = time.minute()
        second = time.second()

        if not self.isMilitaryTime():
            if hour > 12:
                hour -= 12
                self._timeOfDayCombo.setCurrentIndex(1)
            else:
                self._timeOfDayCombo.setCurrentIndex(0)
            hour = str(hour)
        else:
            hour = '{0:02d}'.format(hour)

        nearest = lambda x: int(round(x/5.0)*5.0)

        self._hourCombo.setCurrentIndex(self._hourCombo.findText(hour))
        self._minuteCombo.setCurrentIndex(self._minuteCombo.findText('{0:02d}'.format(nearest(minute))))
        self._secondCombo.setCurrentIndex(self._secondCombo.findText('{0:02d}'.format(nearest(second))))
1026646
def set_current_time(self, t):
        

        method = "set_current_time"

        A = None
        metadata = {method: t}

        send_array(self.socket, A, metadata)
        A, metadata = recv_array(
            self.socket, poll=self.poll, poll_timeout=self.poll_timeout,
            flags=self.zmq_flags)
551307
def now(self):
        ''' 
        '''
        utcnow = datetime.utcnow()
        return utcnow + timedelta(hours=self.time_zone)