[Python] Python UTC datetime object's ISO format doesn't include Z (Zulu or Zero offset)

Discussão em 'Python' iniciado por Stack, Maio 30, 2025.

  1. Stack

    Stack Membro Participativo

    Why python 2.7 doesn't include Z character (Zulu or zero offset) at the end of UTC datetime object's isoformat string unlike JavaScript?

    >>> datetime.datetime.utcnow().isoformat()
    '2013-10-29T09:14:03.895210'


    Whereas in javascript

    >>> console.log(new Date().toISOString());
    2013-10-29T09:38:41.341Z

    Continue reading...

Compartilhe esta Página