#uptime

1 messages · Page 1 of 1 (latest)

mellow furnace
#

how do i get the uptime on the bot in a human readabale way (something like x days, y hours, z seconds)

grave dirge
mellow furnace
#

ight thx

mellow furnace
#

i dont get it

grave dirge
#

what you've done so far

mellow furnace
#

so i got the uptime

#

but how do i format it

grave dirge
#

-d datetime.timedelta

onyx hingeBOT
#

class datetime.timedelta(days=0, seconds=0, microseconds=0, milliseconds=0, minutes=0, hours=0, weeks=0)```
All arguments are optional and default to `0`. Arguments may be integers or floats, and may be positive or negative.

Only *days*, *seconds* and *microseconds* are stored internally. Arguments are converted to those units...
mellow furnace
#

i have that

grave dirge
#

you could use the attrs of the object

mellow furnace
#

what attrs

grave dirge
#

attributes of the object

mellow furnace
#

i want something like this:

#

not -1

grave dirge
mellow furnace
#

ok

grave dirge
#

that's coz present is greater than past (reasoning in numbers)

mellow furnace
#

now i get something like 0:00:08.791210

grave dirge
#

uptime.days -> 0
uptime.hours -> 00
uptime.minutes and so on

grave dirge
#

these are attributes of a timedelta object

mellow furnace
#

ok

#

whats the link to those discord timestamps thingies that change automatically?

onyx hingeBOT
#

disnake.utils.format_dt(dt, /, style='f')```
A helper function to format a [`datetime.datetime`](https://docs.python.org/3/library/datetime.html#datetime.datetime "(in Python v3.10)"), [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.10)") or [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.10)") for presentation within Discord.

This allows for a locale-independent way of presenting data using Discord specific Markdown...