[Django]-How to avoid pandas in converting string to date format

3👍

Yes of course:

from datetime import datetime

date_string = "2017/01/31"

date = datetime.strptime(date_string, "%Y/%m/%d")

print(date)
# datetime.datetime(2017, 1, 31, 0, 0)

Leave a comment