|
|
@@ -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 ()) |