a
    io                     @  sJ   d dl mZ d dlmZmZ d dlmZ ddddZddd	d
dZdS )    )annotations)datetimetimezone)Optionalr   )returnc                   C  s   t tjjddS )zEReturn a naive UTC datetime for consistent SQLite storage/comparison.Ntzinfo)r   nowr   utcreplace r   r   MC:\Users\jasmi\Projects\line-hihaho-voting\backend\app\services\time_utils.pyutc_now   s    r   zOptional[datetime])valuer   c                 C  s:   | du rdS | j du s"|  du r&| S | tjjddS )zENormalize aware datetimes to naive UTC; leave naive values unchanged.Nr   )r   	utcoffset
astimezoner   r
   r   )r   r   r   r   as_utc_naive   s
    r   N)
__future__r   r   r   typingr   r   r   r   r   r   r   <module>   s   