Adicionar o Sustraer Dias en Python
Camilo Nova
CEOPara agregar o sustraer días a una fecha determinada en python lo mejor es hacerlo así:
from datetime import date, timedelta
#Agregar
d=date.today()+timedelta(days=dias)
#Sustraer
d=date.today()-timedelta(days=dias)
La operación respeta los días al cambiar de mes y funciona perfecto.
Written by Camilo Nova
As the Axiacore CEO, Camilo writes about the intersection of technology, design, and business. With a strategic mindset and a deep understanding of the industry, he is dedicated to helping companies grow.