mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-27 13:34:28 +00:00
whelp
This commit is contained in:
parent
a815f26aa6
commit
f5d0779624
1 changed files with 5 additions and 1 deletions
|
@ -466,7 +466,11 @@ def parse_timestring(timestring: str) -> typing.Union[datetime.timedelta, dateti
|
|||
now = datetime.datetime.now()
|
||||
if len(split_date) == 5:
|
||||
# yyyy-mm-dd-hh-mm
|
||||
return datetime.datetime(*split_date)
|
||||
return datetime.datetime(year=int(split_date[0]),
|
||||
month=int(split_date[1]),
|
||||
day=int(split_date[2]),
|
||||
hour=int(split_date[3]),
|
||||
minute=int(split_date[4]))
|
||||
elif len(split_date) == 4:
|
||||
return now.replace(month=int(split_date[0]),
|
||||
day=int(split_date[1]),
|
||||
|
|
Loading…
Reference in a new issue