mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-15 19:45:47 +02:00
Fix incorrect timeformatting
This commit is contained in:
parent
dd60840576
commit
8350b01d85
2 changed files with 7 additions and 2 deletions
|
|
@ -66,7 +66,7 @@ class Slash(commands.Cog):
|
||||||
if time.count(":") == 1:
|
if time.count(":") == 1:
|
||||||
time += ":00"
|
time += ":00"
|
||||||
|
|
||||||
dt = fromString(f"{date} {time}", formatString="%d/%m/%Y %H:%M:%S")
|
dt = fromString(f"{date} {time}", formatString="%d/%m/%Y %H:%M:%S", tzinfo=None)
|
||||||
|
|
||||||
# Add year & course if necessary
|
# Add year & course if necessary
|
||||||
if str(year) not in deadlines:
|
if str(year) not in deadlines:
|
||||||
|
|
|
||||||
|
|
@ -157,7 +157,12 @@ def fromString(timeString: str, formatString="%d/%m/%Y", tzinfo=pytz.timezone("E
|
||||||
"""
|
"""
|
||||||
Constructs a datetime object from an input string
|
Constructs a datetime object from an input string
|
||||||
"""
|
"""
|
||||||
return datetime.datetime.strptime(timeString, formatString).replace(tzinfo=tzinfo)
|
dt = datetime.datetime.strptime(timeString, formatString)
|
||||||
|
|
||||||
|
if tzinfo is not None:
|
||||||
|
dt = dt.replace(tzinfo=tzinfo)
|
||||||
|
|
||||||
|
return dt
|
||||||
|
|
||||||
|
|
||||||
def fromArray(data: List[int]) -> datetime:
|
def fromArray(data: List[int]) -> datetime:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue