I'm trying to extract a date from a string and change the date format from yyyy-mm-dd to yyyy/mm/dd. Somehow I got it wrong.
I read through the links below to help me get there, but need a quick hand.
import re
import datetime
str = "2017/09/15 07:11:00"
x = re.match( r'([^\s]+)',str)
new_x = datetime.datetime.strptime("re.match( r'([^\s]+)',str)", "%Y/%m/%d").strftime("%Y-%m-%d")
print(x)
print(new_x)