Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

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

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"

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

>Solution :

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'))
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading