python datetime to string iso 8601

41

from datetime import datetime
my_date = datetime.now()
print(my_date.strftime('%Y-%m-%dT%H:%M:%S.%f%z'))
from datetime import datetime
my_date = datetime.now()
print(my_date.isoformat())

Comments

Submit
0 Comments