"""
Datetime tools
"""
import datetime as dt
from enum import IntEnum
from typing import TypeVar, Callable, Any, Union

_CT = TypeVar('_CT', covariant=True)
_CRT = TypeVar('_CRT', covariant=True)
_CF = Union[Callable[..., _CRT], _CRT]


AnyDateTime = TypeVar('AnyDateTime', dt.date, dt.datetime)
now: Callable[[], dt.datetime]
utcnow: Callable[[], dt.datetime]
today: Callable[[], dt.date]

def locnow() -> dt.datetime: ...
def timestamp(d: dt.datetime=...) -> int: ...
def timestamp_ms(d: dt.datetime=...) -> int: ...
def localize(_tz: dt.tzinfo, t1: dt.datetime) -> AnyDateTime: ...
def fromtimestamp(tmp: int): ...
def to_datetime(raw: Union[str, int, float, AnyDateTime]) -> AnyDateTime: ...
def format_dt(p: str, d: AnyDateTime = ...) -> _CF: ...

def fmt_std_date(d: AnyDateTime) -> str: ...
def fmt_std_datetime(d: AnyDateTime) -> str: ...

class FreqName(IntEnum): ...
    # Yearly: int = ...
    # Monthly: int = ...
    # Weekly: int = ...
    # Daily: int = ...
    # Hourly: int = ...
    # Minutely: int = ...
    # Secondly: int = ...

def daterange(freq: Union[int, FreqName], start_date: AnyDateTime, **kwargs) -> Any: ...
