1

I've to find days difference. I've string object of date in this format '7/15/2019'. I want to convert it into date time object.

date = '7/15/2019'
start_time = datetime.strptime(date, '%b %d %Y')
ValueError: time data '7/15/2019' does not match format '%b %d %Y'
1
  • 3
    start_time = datetime.strptime(date, '%m/%d/%Y')? Commented Jul 30, 2019 at 21:36

1 Answer 1

1
`import datetime
date = '7/15/2019'
start_time = datetime.datetime.strptime(date, '%m/%d/%Y').date()`
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.