Return an RFC 3339-compliant timestamp.

        Returns:
            (str): Timestamp string according to RFC 3339 spec.
198895
def rfc3339(self):
        
        if self._nanosecond == 0:
            return to_rfc3339(self)
        nanos = str(self._nanosecond).rjust(9, '0').rstrip("0")
        return "{}.{}Z".format(self.strftime(_RFC3339_NO_FRACTION), nanos)
221992
def get_timestamp_metadata(self):
        
        # Implemented from template for osid.resource.ResourceForm.get_group_metadata_template
        metadata = dict(self._mdata['timestamp'])
        metadata.update({'existing_date_time_values': self._my_map['timestamp']})
        return Metadata(**metadata)
1180972
def to_datetime_string(self) -> str:
        
        date_display = self.to_iso_date_string()
        time_display = self.to_long_time_string()
        return f"{date_display} {time_display}"
730651
def Timestamp():
    
    timestamp = ''
    try:
        timestamp = str(datetime.datetime.now())+' UTC'
    except Exception as e:  # pragma: no cover
        logger.error('Could not get current time ' + str(e))
    return timestamp
1332029
def pkt2uptime(pkt, HZ=100):
    """"""
    if not isinstance(pkt, Packet):
        raise TypeError("Not a TCP packet")
    if isinstance(pkt, NoPayload):
        raise TypeError("Not a TCP packet")
    if not isinstance(pkt, TCP):
        return pkt2uptime(pkt.payload)
    for opt in pkt.options:
        if opt[0] == "Timestamp":
            # t = pkt.time - opt[1][0] * 1.0/HZ
            # return time.ctime(t)
            t = opt[1][0] / HZ
            return t
    raise TypeError("No timestamp option")
740836
def get_timestamp(str_len=13):
    
    if isinstance(str_len, integer_types) and 0 < str_len < 17:
        return builtin_str(time.time()).replace(".", "")[:str_len]

    raise ParamsError("timestamp length can only between 0 and 16.")
295707
def certify_timestamp(value, required=True):
    
    if certify_required(
        value=value,
        required=required,
    ):
        return

    if not isinstance(value, datetime):
        raise CertifierTypeError(
            message="expected timestamp (datetime), but value is of type {cls!r}".format(
                cls=value.__class__.__name__),
            value=value,
            required=required,
        )
1105065
def _rfc3339_to_datetime(dt_str):
    
    return datetime.datetime.strptime(dt_str, _RFC3339_MICROS).replace(tzinfo=UTC)
495048
def get_valid_time_stamp():
    
    time_stamp = str(datetime.datetime.now())
    time_stamp = "time_" + time_stamp.replace("-", "_").replace(":", "_").replace(" ", "_").replace(".", "_")
    return time_stamp
1043513
def timestamp
      return nil if self.version != 1
      gmt_timestamp_100_nanoseconds = 0
      gmt_timestamp_100_nanoseconds +=
        ((self.time_hi_and_version  & 0x0FFF) << 48)
      gmt_timestamp_100_nanoseconds += (self.time_mid << 32)
      gmt_timestamp_100_nanoseconds += self.time_low
      return Time.at(
        (gmt_timestamp_100_nanoseconds - 0x01B21DD213814000) / 10000000.0)
    end
312855
def datetime_from_timestamp(n, epoch=datetime.datetime.fromordinal(693594)):
    
    return epoch + datetime.timedelta(n)
334467
def timestamp(num_params, p_levels, k_choices, N):
    
    string = "_v%s_l%s_gs%s_k%s_N%s_%s.txt" % (num_params,
                                               p_levels,
                                               k_choices,
                                               N,
                                               dt.strftime(dt.now(),
                                                           "%d%m%y%H%M%S"))
    return string
43068
def rfc2822(self):

        ''' 
            
        '''

    # define format
        js_format = '%a, %d %b %Y %H:%M:%S GMT'
        utc_time = self.astimezone(pytz.utc)

        return format(utc_time, js_format)
27574
def repr_timestamp(timestamp):
    """"""
    if timestamp is None:
        return 'None'
    dt = datetime_from_timestamp(timestamp)
    ret = "%d (%s)" % (timestamp,
                       dt.strftime('%Y-%m-%d %H:%M:%S.%f %Z'))
    return ret
999569
def timestamp(self, posix: bool = True, **kwargs) -> Union[str, int]:
        
        stamp = self.datetime(**kwargs)

        if posix:
            return timegm(stamp.utctimetuple())

        return stamp.strftime('%Y-%m-%dT%H:%M:%SZ')
777978
def timestamp(s):
    '''
    
    '''
    ms_s = s[6:]
    ms = ms_s and int(float(ms_s) * 1000000) or 0

    t = datetime.time(
        hour=int(s[0:2]),
        minute=int(s[2:4]),
        second=int(s[4:6]),
        microsecond=ms)
    return t
355925
def datetime(self):
        
        if self._time == '':
            return datetime.strptime(self._date, '%b %d, %Y')
        date_string = '%s %s' % (self._date, self._time)
        return datetime.strptime(date_string, '%b %d, %Y %I:%M %p')