I rarely can connected to the virtual machine in the classroom, so I practice locally, got confused for above code in the screenshot I took:
Should row[2] be first transfer to a datatime object, then use strptime() function to create a string from it?
The given answer use the strings from row[2] directly, please check this part: 6. Using Strftime to format dates On working with dates and times in Python, thank you.
Thank you for answering my question, I understand what you mean, but I have a new puzzle which is when row[2] be updated to datetime format?
The online programming platform doesn’t give any comments that says row[2] already been converted to be datetime and the raw type for row[2] from the dataset is string format.