mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Fix train timestamps
This commit is contained in:
parent
c8946fdc49
commit
f6c324d656
3 changed files with 7 additions and 7 deletions
|
|
@ -94,7 +94,7 @@ class Corona(commands.Cog):
|
|||
inline=False)
|
||||
|
||||
# Timestamp of last update
|
||||
timeFormatted = timeFormatters.epochToDate(dic["today"]["updated"])
|
||||
timeFormatted = timeFormatters.epochToDate(int(dic["today"]["updated"])/1000)
|
||||
embed.set_footer(text="Laatst geüpdatet op {} ({} geleden)".format(
|
||||
timeFormatted["date"], timeFormatted["timeAgo"]))
|
||||
await ctx.send(embed=embed)
|
||||
|
|
@ -146,7 +146,7 @@ class Corona(commands.Cog):
|
|||
distribution[0], distribution[1], distribution[2]), inline=False)
|
||||
|
||||
# Timestamp of last update
|
||||
timeFormatted = timeFormatters.epochToDate(dic["today"]["updated"])
|
||||
timeFormatted = timeFormatters.epochToDate(int(dic["today"]["updated"])/1000)
|
||||
embed.set_footer(text="Laatst geüpdatet op {} ({} geleden)".format(
|
||||
timeFormatted["date"], timeFormatted["timeAgo"]))
|
||||
await ctx.send(embed=embed)
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@ from decorators import help
|
|||
import discord
|
||||
from discord.ext import commands, menus
|
||||
from enums.help_categories import Category
|
||||
from functions import checks
|
||||
from functions import checks, timeFormatters
|
||||
import requests
|
||||
|
||||
|
||||
|
|
@ -69,7 +69,7 @@ class Train(commands.Cog):
|
|||
return str(minutes) + "m"
|
||||
return "{}h{:02}m".format(minutes // 60, minutes % 60)
|
||||
else:
|
||||
return datetime.datetime.fromtimestamp(int(timestamp)).strftime("%H:%M")
|
||||
return timeFormatters.epochToDate(int(timestamp), "%H:%M")["date"]
|
||||
|
||||
def formatDelay(self, seconds):
|
||||
seconds = int(seconds)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue