-3

so I'm trying to make this date more readable can someone please help me...

So Right now my current code is:

embed.add_field(name="Joined at:", value = str(member.joined_at), inline=False)

And when I run this code in discord I get this: 1

But I want to get something that looks like: enter image description here

As you can see it is a lot easier to read and understand.

Could someone please help me?!

Thanks-

David Erickson
  • 15,734
  • 2
  • 16
  • 32

3 Answers3

0

I think strftime() is what you're looking for.

roob
  • 121
  • 1
  • 3
0

Use the timestamp arg.

embed=discord.Embed(title='Joined at:', timestamp=member.joined_at)

This will show the time reletive to the displaying device's timezone

Jab
  • 25,138
  • 21
  • 72
  • 111
0

Try setting your value to the following format:

value = datetime.date.strftime(member.joined_at, '%a, %b %d, %Y, %I %p')

https://docs.python.org/2/library/datetime.html?highlight=strftime#strftime-and-strptime-behavior

David Erickson
  • 15,734
  • 2
  • 16
  • 32