[Python] Unix timestamp to iso 8601 time format

Discussão em 'Python' iniciado por Stack, Fevereiro 22, 2025.

  1. Stack

    Stack Membro Participativo


    When I convert unix time 1463288494 to isoformat i get 2016-05-14T22:01:34. How can I get the output including the -07:00. In this format 2016-05-14T22:01:34-07:00
    ​

    from datetime import datetime
    t = int("1463288494")
    print(datetime.fromtimestamp(t).isoformat())

    Continue reading...

Compartilhe esta Página