
    d                     (    d dl Z ddZddZd Zd Zy)    Nc                 b    | t         j                   j                         } | j                         S )z
    Returns a string with the given datetime in iso format. If no datetime is given as parameter, it
    uses datetime.utcnow().
    )datetimeutcnow	isoformatdts    G/usr/lib/python3/dist-packages/azurelinuxagent/common/utils/timeutil.pycreate_timestampr
      s)    
 
z%%'<<>    c                 d    | t         j                   j                         } | j                  d      S )zj
    Returns a string with the given datetime formatted as a timestamp for the agent's history folder
    z%Y-%m-%dT%H-%M-%S)r   r   strftimer   s    r	   create_history_timestampr      s-     
z%%';;*++r   c                 f    t        dt        | t        j                  j                  z
        z        S )z
    Converts 'dt', a datetime, to the number of ticks (1 tick == 1/10000000 sec) since datetime.min (0001-01-01 00:00:00).

    Note that the resolution of a datetime goes only to microseconds.
    i )inttotal_secondsr   minr   s    r	   datetime_to_ticksr      s*     wrH,=,=,A,A'ABBCCr   c                 `    d| j                   z  | j                  z   dz  | j                  z   dz  S )z
    Compute the total_seconds for timedelta 'td'. Used instead timedelta.total_seconds() because 2.6 does not implement total_seconds.
    g     @i@B )dayssecondsmicrosecondsr   s    r	   r   r   "   s0     bgg%

2g=OSZZZr   )N)r   r
   r   r   r    r   r	   <module>r      s     ,D[r   