[Python] How to extract the year from a Python datetime object?

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

  1. Stack

    Stack Membro Participativo

    I would like to extract the year from the current date using Python.

    In C#, this looks like:

    DateTime a = DateTime.Now()
    a.Year


    What is required in Python?

    Continue reading...

Compartilhe esta Página