How can I get this string in the format "%Y-%m-%d %H:%M:%S"?
myDateTime = 'datetime.datetime(2012, 11, 16, 3, 0)'
I have tried:
x = myDateTime.strftime("%Y-%m-%d %H:%M:%S")
and I get the error:
"Attribute Error: 'str' object has no attribute
'strftime'".
I also tried using strptime but myDateTime is not of type datetime.
My objective is to get the string to be interpreted verbatim then I would have a datetime object that I could work with.
mm-dd-yyis a terrible format. If mdy order is used, it is better to use/, with dmy, it should better be a.and ymd, the one to be favourized, is delimited with-.