Ich mag datetime.datetime(2016, 11, 21, 5, 34, 38, 826339, tzinfo=<UTC>)
als Nov. 21, 2016, 11:04 a.m.
Änderung Datetime-Objekt Zeichenfolge
Die Zeit in dem Datetime-Objekt konvertieren ist in UST aber ich will es in IST (UST + 5.30) umgewandelt werden.
Ich versuchte Strftime wie mit: hier
>>> datetime(2016, 11, 21, 5, 34, 38, 826339, tzinfo=<UTC>).isoformat(' ')
File "<stdin>", line 1
datetime(2016, 11, 21, 5, 34, 38, 826339, tzinfo=<UTC>).isoformat(' ')
^
SyntaxError: invalid syntax
Kann ich etwas Hilfe bekommen.
PS: Ich verwende Python
EDIT:
cr_date = datetime(2016, 11, 21, 5, 34, 38, 826339) #excluding the timezone
ich teilweise gewünschte reults durch bekommen:
cr_date.strftime('%b. %d, %Y %H:%M')
'Oct. 31, 2013 18:23
hatte nicht den am/pm obwohl