Return the access time in seconds.
193359
def st_atime(self):
        """"""
        atime = self._st_atime_ns / 1e9
        return atime if self.use_float else int(atime)
734059
def time_to_seconds(x):
    """"""
    if isinstance(x, time):
        return ((((x.hour * 60) + x.minute) * 60 + x.second) * 10**6 +
                x.microsecond) / 10**6

    if is_str(x):
        return x
    # Clamp to valid time
    return x and max(0, min(x, 24 * 3600 - 10**-6))
762554
def to_time(self):
        
        return time(self.hours, self.minutes, self.seconds,
                    self.milliseconds * 1000)
685135
def time_string(seconds):
    """"""
    s = int(round(seconds))  # round to nearest second
    h, s = divmod(s, 3600)  # get hours and remainder
    m, s = divmod(s, 60)  # split remainder into minutes and seconds
    return "%2i:%02i:%02i" % (h, m, s)
481667
def get_timestamp(self, **kwargs):
        """"""
        timestamp = kwargs.get('timestamp')
        if not timestamp:
            now = datetime.datetime.utcnow()
            timestamp = now.strftime("%Y-%m-%dT%H:%M:%S") + ".%03d" % (now.microsecond / 1000) + "Z"

        return timestamp
207596
def __get_timemachine(self):
        """"""
        if not self.__timemachine:
            self.__timemachine = TimeMachine(
                self.object_uid,
                step = self.id,
            )

        return self.__timemachine.at(self.id)
104020
def GetTimeRange(cls):
    """"""
    first = getattr(cls, '_lower', 0)
    last = getattr(cls, '_upper', cls.MAX_INT64)

    if first < last:
      return first, last

    return last, first
739594
def request_time(self) -> float:
        """"""
        if self._finish_time is None:
            return time.time() - self._start_time
        else:
            return self._finish_time - self._start_time
760214
def get_time_offset():
    
    try:
        resp = webapi.post('ITwoFactorService', 'QueryTime', 1, params={'http_timeout': 10})
    except:
        return None

    ts = int(time())
    return int(resp.get('response', {}).get('server_time', ts)) - ts
1310816
def now (time_t = None, slug = False):
  '''
  '''
  if not time_t:
    time_t = time ()
  time_s = strftime (
    DEFAULT_SLUGFORMAT if slug else DEFAULT_TIMEFORMAT,
    gmtime (time_t))
  return (int (time_t), time_s)
1169625
def st_mtime(self):
        """"""
        mtime = self._st_mtime_ns / 1e9
        return mtime if self.use_float else int(mtime)
1097151
def access_time(self):
    """"""
    if self._stat_info is None:
      return None

    timestamp = int(self._stat_info.st_atime)
    return dfdatetime_posix_time.PosixTime(timestamp=timestamp)
302160
def get_time_at(time_in=None, time_at=None, out_fmt='%Y-%m-%dT%H:%M:%S'):
    '''
    
    '''
    dt = get_timestamp_at(time_in=time_in, time_at=time_at)
    return time.strftime(out_fmt, time.localtime(dt))
885857
def current_time(self) -> datetime:
        """"""
        _date = datetime.strptime(self.obj.SBRes.SBReq.StartT.get("date"), "%Y%m%d")
        _time = datetime.strptime(self.obj.SBRes.SBReq.StartT.get("time"), "%H:%M")
        return datetime.combine(_date.date(), _time.time())
294035
def get_time():
    
    import datetime
    time=make_pathable_string('%s' % datetime.datetime.now())
    return time.replace('-','_').replace(':','_').replace('.','_')
1247745
def get_packet_time(self, pkt):
        """"""
        if pkt.sent_time:
          t = pkt.sent_time
          sec = int(t)
        else:
          t = pkt.time
          sec = int(t)
        usec = int(round((t-sec)*1000000))
        return (sec,usec)
139196
def seconds(num):
    
    now = pytime.time()
    end = now + num
    until(end)