Quantcast
Channel: Howtos & more …– LANbugs
Viewing all articles
Browse latest Browse all 144

Python: Snippet – Letzten Monat ausgeben

$
0
0
import datetime

today = datetime.date.today()
first = today.replace(day=1)
lastMonth = first - datetime.timedelta(days=1)
str_last_month = lastMonth.strftime("%m-%Y")

print(str_last_month)


'05-2019'


Viewing all articles
Browse latest Browse all 144