Server : LiteSpeed
System : Linux server51.dnsbootclub.com 4.18.0-553.62.1.lve.el8.x86_64 #1 SMP Mon Jul 21 17:50:35 UTC 2025 x86_64
User : nandedex ( 1060)
PHP Version : 8.1.33
Disable Function : NONE
Directory :  /opt/cppython/lib/python3.8/site-packages/google/protobuf/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]


Current File : //opt/cppython/lib/python3.8/site-packages/google/protobuf/__pycache__/timestamp.cpython-38.pyc
U

N��g=�@s�dZddlZddlmZddlmZeed�dd�Zeed�d	d
�Z	eed�dd
�Z
eed�dd�Zeed�dd�Zed�dd�Z
eed�dd�Zeed�dd�Zeed�dd�Zeed�dd�Zeed�d d!�Zd%eeejejd"�d#d$�ZdS)&z#Contains the Timestamp helper APIs.�N)�Optional)�	Timestamp)�value�returncCst�}|�|�|S)a<Parse a RFC 3339 date string format to Timestamp.

  Args:
    value: A date string. Any fractional digits (or none) and any offset are
      accepted as long as they fit into nano-seconds precision. Example of
      accepted format: '1972-01-01T10:00:20.021-05:00'

  Raises:
    ValueError: On parsing problems.
  )rZFromJsonString)r�	timestamp�r�F/opt/cppython/lib/python3.8/site-packages/google/protobuf/timestamp.py�from_json_strings
r	)�microsrcCst�}|�|�|S)z/Converts microseconds since epoch to Timestamp.)rZFromMicroseconds)r
rrrr�from_microseconds s
r)�millisrcCst�}|�|�|S)z/Converts milliseconds since epoch to Timestamp.)rZFromMilliseconds)rrrrr�from_milliseconds's
r
)�nanosrcCst�}|�|�|S)z.Converts nanoseconds since epoch to Timestamp.)rZFromNanoseconds)rrrrr�from_nanoseconds.s
r)�secondsrcCst�}|�|�|S)z*Converts seconds since epoch to Timestamp.)rZFromSeconds)rrrrr�from_seconds5s
r)rcCs"t�}|�tjjtjjd��|S)z&Converts the current UTC to Timestamp.)�tz)rZFromDatetime�datetime�now�timezone�utc)rrrr�from_current_time<sr)�tsrcCs|��S)aConverts Timestamp to RFC 3339 date string format.

  Returns:
    A string converted from timestamp. The string is always Z-normalized
    and uses 3, 6 or 9 fractional digits as required to represent the
    exact time. Example of the return format: '1972-01-01T10:00:20.021Z'
  )ZToJsonString�rrrr�to_json_stringCsrcCs|��S)z/Converts Timestamp to microseconds since epoch.)ZToMicrosecondsrrrr�to_microsecondsNsrcCs|��S)z/Converts Timestamp to milliseconds since epoch.)ZToMillisecondsrrrr�to_millisecondsSsrcCs|��S)z.Converts Timestamp to nanoseconds since epoch.)Z
ToNanosecondsrrrr�to_nanosecondsXsrcCs|��S)z*Converts Timestamp to seconds since epoch.)Z	ToSecondsrrrr�
to_seconds]sr)rrrcCs|j|d�S)a7Converts Timestamp to a datetime.

  Args:
    tz: A datetime.tzinfo subclass; defaults to None.

  Returns:
    If tzinfo is None, returns a timezone-naive UTC datetime (with no timezone
    information, i.e. not aware that it's UTC).

    Otherwise, returns a timezone-aware datetime in the input timezone.
  )�tzinfo)Z
ToDatetime)rrrrr�to_datetimebsr )N)�__doc__r�typingrZgoogle.protobuf.timestamp_pb2r�strr	�floatrr
rrrr�intrrrrrr rrrr�<module>s(��

F1le Man4ger