
    g                     0    d dl Zdej                   defdZy)    Nvreturnc                     dt         j                  dt        fd}| j                   ||       S t         j                  j	                         j                         j                  }| j                  |      } ||      S )a  
    Serialize a datetime including timezone info.

    Uses the timezone info provided if present, otherwise uses the current runtime's timezone info.

    UTC datetimes end in "Z" while all other timezones are represented as offset from UTC, e.g. +05:00.
    r   r   c                    | j                   e| j                   j                  d       t        j                  j                  j                  d       k(  r | j                         j                  dd      S | j                         S )Nz+00:00Z)tzinfotznamedttimezoneutc	isoformatreplace)r   s    O/var/www/openai/venv/lib/python3.12/site-packages/cohere/core/datetime_utils.py_serialize_zoned_datetimez5serialize_datetime.<locals>._serialize_zoned_datetime   s[    88AHHOOD$9R[[__=S=STX=Y$Y;;=((377 ;;=     )r   )r
   datetimestrr   now
astimezoner   )r   r   local_tzlocalized_dts       r   serialize_datetimer      sj    !R[[ !S ! 	xx(++;;??$//188yyy1(66r   )r   r
   r   r    r   r   <module>r      s!    7"++ 7# 7r   