diff --git a/main.py b/main.py new file mode 100644 index 0000000..56e8bfb --- /dev/null +++ b/main.py @@ -0,0 +1,36 @@ +from __future__ import annotations + +import asyncio +from datetime import date, datetime, time + + +async def main ( +) -> None: + ... + + +def dt_to_tuple ( + dt: datetime | date | time, +) -> tuple[int | None, int | None, int | None, int | None, int | None, int | None]: + year: int | None = None + month: int | None = None + day: int | None = None + hour: int | None = None + minute: int | None = None + second: int | None = None + + if not isinstance (dt, time): + year = dt.year + month = dt.month + day = dt.day + + if not isinstance (dt, date): + hour = dt.hour + minute = dt.minute + second = dt.second + + return (year, month, day, hour, minute, second) + + +if __name__ == '__main__': + asyncio.run (main ())