HEX
Server: Apache
System: Linux 185.122.168.184.host.secureserver.net 5.14.0-570.60.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Nov 5 05:00:59 EST 2025 x86_64
User: barbeatleanalyti (1024)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //var/opt/nydus/ops/primordial/__pycache__/timeutils.cpython-39.pyc
a

�,�h��@sdddlmZddlZddlmZddlmZmZeje	d�dd�Z
dejeejee
d	�d
d�ZdS)
�)�OptionalN)�utc)�CANONICAL_TIMESTRING_FORMAT�+CANONICAL_TIMESTRING_FORMAT_NO_MICROSECONDS)�in_time�returncCst|t�ddd����S)zu
    Return integer seconds since epoch.

    :param in_time: Datetime
    :returns: Integer seconds since epoch
    i��)�int�datetime�
total_seconds)r�r�E/opt/nydus/tmp/pip-target-wkfpz8uv/lib/python/primordial/timeutils.py�datetime_to_epoch_seconds
srT)�dt�tz�microsecondsrcCsP|rtnt}|jdur2|dur&td��|j|d�}|jturF|�t�}|�|�S)a�
    Return a string representation of a datetime in ISO8601 format (YYYY-MM-DDTHH:MM:SS.ssssssZ)
    in the UTC (Z) timezone.

    :param dt: The datetime object.
    :param tz: The timezone to assume when coverting a naive datetime to UTC (Required if `dt` is naive).
    :param microseconds: Whether to include microseconds in the representation. Defaults to `True`.
    :returns: ISO8601-formatted string representation
    :raises ValueError: If the datetime is naive, and no tz is provided
    Nz7`tz` param must be provided if datetime object is naive)�tzinfo)rrr�
ValueError�replace�UTC�
astimezone�strftime)rrrZtformatrrr
�iso8601_utcs


r)NT)�typingrr
ZpytzrrZprimordial.constantsrrr	rr�bool�strrrrrr
�<module>s