-2

I need help creating a function that takes a user input(Numeric Date) and turns it into a string For Example: input: 2018-06-20 output: June 20th 2018 any hints or code would help me out. Thank you

1 Answers1

0
import datetime
d = '2018-06-20'
datetime.datetime.strptime(d, '%Y-%m-%d').strftime('%B %d %Y')

Output:

June 20 2018

For more formatting you can look here

Jeril
  • 7,858
  • 3
  • 52
  • 69