I have a weekday integer (0,1,2...) and I need to get the day name (\'Monday\', \'Tuesday\',...).
Is there a built in Python function or way of doing this?
H
You can create your own list and use it with format.
import datetime days_ES = ["Domingo", "Lunes", "Martes", "Miércoles", "Jueves", "Viernes", "Sábado"] t = datetime.datetime.now() f = t.strftime("{%w} %Y-%m-%d").format(*days_ES) print(f)
Prints:
Lunes 2018-03-12