#uptime
1 messages · Page 1 of 1 (latest)
use start_time = datetime.datetime.now() to save the start time and in your command do uptime = start_time - datetime.datetime.now()
this will return a timedelta object, check the docs for more infos
ight thx
i dont get it
what you've done so far
-d datetime.timedelta
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...
i have that
you could use the attrs of the object
what attrs
attributes of the object
yeah just switch here and do
datetime.datetime.now() - start_time
ok
that's coz present is greater than past (reasoning in numbers)
now i get something like 0:00:08.791210
uptime.days -> 0
uptime.hours -> 00
uptime.minutes and so on
ok
whats the link to those discord timestamps thingies that change automatically?
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...