:return: Steam aligned timestamp
        :rtype: int
508525
def get_time(self):
        
        if (self.steam_time_offset is None
           or (self.align_time_every and (time() - self._offset_last_check) > self.align_time_every)
           ):
            self.steam_time_offset = get_time_offset()

            if self.steam_time_offset is not None:
                self._offset_last_check = time()

        return int(time() + (self.steam_time_offset or 0))
1153096
def pretty_timestamp(timestamp, date_format='%a-%m_%d_%y:%H:%M:%S'):
    """"""
    return time.strftime(date_format,
                         time.localtime(int(str(timestamp)[:10])))
1348084
def _gmtime(timestamp):
    
    try:
        return time.gmtime(timestamp)
    except OSError:
        dt = datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=timestamp)
        dst = int(_isdst(dt))
        return time.struct_time(dt.timetuple()[:8] + tuple([dst]))
98046
def get_datetime_interval(timestamp, diff, offset=0):
    
    fin_datetime = datetime.datetime.fromtimestamp(timestamp + offset)
    ini_datetime = datetime.datetime.fromtimestamp(timestamp - diff)
    return ini_datetime, fin_datetime
482245
def datetime_to_timestamp(time: datetime) -> Timestamp:
    
    protime = Timestamp()
    protime.FromDatetime(time)
    return protime
713388
def get_timedelta(self, now=None):
        
        def datetime_to_time(timestamp):
            atime = time.mktime(timestamp.timetuple())
            atime += timestamp.microsecond / 10.0**6
            return atime
        if self.started is not None:
            now = now or datetime.datetime.now()
            started_time = datetime_to_time(self.started)
            now_time = datetime_to_time(now)
            return now_time - started_time
        return None
435006
def target_timestamp(self) -> datetime:
        """"""
        timestamp = DB.get_hash_value(self._key, 'target_timestamp')
        return datetime_from_isoformat(timestamp)
447969
def time_since(self, mtype):
        ''''''
        if not mtype in self.messages:
            return time.time() - self.start_time
        return time.time() - self.messages[mtype]._timestamp
906375
def GetPlasoTimestamp(self):
    
    normalized_timestamp = self._GetNormalizedTimestamp()
    if normalized_timestamp is None:
      return None

    normalized_timestamp *= definitions.MICROSECONDS_PER_SECOND
    normalized_timestamp = normalized_timestamp.quantize(
        1, rounding=decimal.ROUND_HALF_UP)
    return int(normalized_timestamp)
99524
def getUTC(self):
        
        timeUTC = self.time.getUTC(self.utcoffset)
        dateUTC = Date(round(self.jd))
        return Datetime(dateUTC, timeUTC)
385569
def timestamp_normalized(self):
        
        if not self.timestamp:
            return None

        if isinstance(self.timestamp, six.integer_types):
            return self.timestamp

        if isinstance(self.timestamp, timedelta):
            tmp = datetime.now() + self.timestamp
        else:
            tmp = self.timestamp

        return int(time.mktime(tmp.timetuple()) * 1e+6 + tmp.microsecond)
1199861
def utcfromtimestamp(cls, timestamp):
    """"""
    obj = datetime.datetime.utcfromtimestamp(timestamp)
    obj = pytz.utc.localize(obj)
    return cls(obj)
147973
def getUTC(self, utcoffset):
        
        newTime = (self.value - utcoffset.value) % 24
        return Time(newTime)
169140
def ToDatetime(self):
    """"""
    return datetime.utcfromtimestamp(
        self.seconds + self.nanos / float(_NANOS_PER_SECOND))
1084135
def get_total_time(self):
        
        first_step = self.steps[0]
        last_step = self.steps[-1]
        seconds = self.history[last_step]["__timestamp__"] \
                  - self.history[first_step]["__timestamp__"]
        return datetime.timedelta(seconds=seconds)
265625
def format_timestamp(timestamp):
        
        tz_info = tz.tzutc()
        return datetime.fromtimestamp(timestamp, tz=tz_info).strftime("%Y-%m-%dT%H:%M:%S.000Z")
539492
def QA_util_time_stamp(time_):
    
    if len(str(time_)) == 10:
        # yyyy-mm-dd格式
        return time.mktime(time.strptime(time_, '%Y-%m-%d'))
    elif len(str(time_)) == 16:
        # yyyy-mm-dd hh:mm格式
        return time.mktime(time.strptime(time_, '%Y-%m-%d %H:%M'))
    else:
        timestr = str(time_)[0:19]
        return time.mktime(time.strptime(timestr, '%Y-%m-%d %H:%M:%S'))