We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
format_dt
1 parent 4de740a commit 8ee4d73Copy full SHA for 8ee4d73
discord/utils.py
@@ -1279,13 +1279,7 @@ def format_dt(
1279
The formatted string.
1280
"""
1281
if isinstance(dt, datetime.time):
1282
- if style is None:
1283
- style = "t"
1284
- elif style not in ("t", "T"):
1285
- raise ValueError("Time styles must be 't' or 'T'.")
1286
- dt = datetime.datetime.combine(
1287
- datetime.datetime.fromtimestamp(DISCORD_EPOCH, tz=datetime.UTC), dt
1288
- )
+ dt = datetime.datetime.combine(datetime.datetime.now(), dt)
1289
if style is None:
1290
return f"<t:{int(dt.timestamp())}>"
1291
return f"<t:{int(dt.timestamp())}:{style}>"
0 commit comments