-3

I get responses that deliver the whole date, but that adds overhead.

from datetime import datetime

datetime.today().strftime('%Y-%m-%d')
Al Martins
  • 431
  • 5
  • 13

1 Answers1

0

This works:

this_year=datetime.today().strftime('%Y')
this_year=int(this_year)

Anything more simple than that?

Yes, thanks luigigi

datetime.today().year
Al Martins
  • 431
  • 5
  • 13