みてるぞ 1 week ago
parent
commit
b793b44cb7
1 changed files with 36 additions and 0 deletions
  1. +36
    -0
      main.py

+ 36
- 0
main.py View File

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

Loading…
Cancel
Save