[Python] Formating "posted x seconds ago" in Jinja 2(Flask) with strftime? [duplicate]

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

  1. Stack

    Stack Membro Participativo

    I'd like to make my code a little more user-friendly such that when users post something, i'd like it to say "x seconds/hour/day ago"

    so far my code is

    {{ post.date_posted.strftime('%Y-%m-%d %H:%M:%S') }}

    Continue reading...

Compartilhe esta Página