1

I am trying to convert the following string in datetime format

"14DEC2014"

Does anyone have an advice on how to do this, I have been stuck on this one for a day or two now

1

1 Answer 1

0
import pandas as pd

test = '14DEC2014'
test = pd.to_datetime(test)
print(test)

output:

2014-12-14 00:00:00

If you would like to only have the date:

test = pd.to_datetime(test).date()

output:

2014-12-14
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.