I want to implement scheduling functionality, and for that, I need to convert the DateTime format. I am trying to format DateTime in the views.py file. But I am getting this error while converting data to DateTime.
Here is my code.
FinalScheduleTime = datetime.datetime.strptime(scheduletime, "%Y-%m-%d %H%M%S.%f").date()
FinalScheduleTime = datetime.datetime.strptime(scheduletime, "%Y-%m-%d %H%M%S.%f").strftime('%Y-%m-%d')
I have tried both ways to convert data but it is not working for me. I am new to python Django. Grateful for the help in advance.