Home > Net >  how to convert ISO 8601 to Date time(Utc) in Python
how to convert ISO 8601 to Date time(Utc) in Python

Time:09-04

I have time stamp in ISO format "2022-06-19T00:00:00 00:00"

and want to convert it in to Date time(utc) format "Jun 19, 2022"

CodePudding user response:

This can be done using the built-in datetime module:

import datetime as dt

input_string = '2022-06-19T00:00:00 00:00'
date = dt.datetime.fromisoformat(input_string)
print(date.strftime('%b %d, %Y'))
  • Related