-1

I have a variable called created = created[1],created[2], created[0] that outputs a date in the form of [(12, 11, 2019)]. I want the date to be formatted like 12/11/2019. How would I got about changing the formatting in python.

created = time.localtime(user.created / 1000)
created = created[1],created[2], created[0]
blah
  • 9
  • 1

1 Answers1

0

The second line can be converted into string by

created = str(created[1]) + '/' + str(created[2]) + '/' + str(created[0])

Then you get what you want to get.

The only thing to remember - if you print(type(created)) now, you will see that created is string type!

MaciejB
  • 76
  • 8