[Python] How do I import this timestamp, and then get days since the timestamp?

Discussão em 'Python' iniciado por Stack, Setembro 27, 2024.

  1. Stack

    Stack Membro Participativo

    I am receiving a timestamp as a string in this format 2024-09-27T04:58:04.894614Z

    I've done a lot of playing and reading around using import datetime, converting to datetime objects

    e.g. timestamp = datetime.strptime(timestamp, '%Y-%m-%d %H:%M:%S.%f')

    But datetime seems extremely confusing to use.

    I am current using

    from datetime import datetime, date, time, timedelta which cannot be changed.

    How can I get the number of days since the imported timestamp please?

    Continue reading...

Compartilhe esta Página