2023-06-09 14:55:51 +00:00
|
|
|
"""Starrail Chronicle Base Model."""
|
2024-03-29 13:48:07 +00:00
|
|
|
|
2023-06-09 14:55:51 +00:00
|
|
|
import datetime
|
2023-07-21 09:11:30 +00:00
|
|
|
from typing import Optional
|
2023-06-09 14:55:51 +00:00
|
|
|
|
|
|
|
from simnet.models.base import APIModel
|
|
|
|
|
|
|
|
|
|
|
|
class PartialTime(APIModel):
|
|
|
|
"""Partial time model."""
|
|
|
|
|
|
|
|
year: int
|
|
|
|
month: int
|
|
|
|
day: int
|
|
|
|
hour: int
|
|
|
|
minute: int
|
2023-07-21 09:11:30 +00:00
|
|
|
second: Optional[int] = None
|
2023-06-09 14:55:51 +00:00
|
|
|
|
|
|
|
@property
|
|
|
|
def datetime(self) -> datetime.datetime:
|
2023-07-21 09:11:30 +00:00
|
|
|
return datetime.datetime(self.year, self.month, self.day, self.hour, self.minute, self.second or 0)
|