0
Good afternoon guys, I’m trying to make a program that always updates a month to my date: Example I have a minimum date, maximum date and the current date I want that whenever my min date is less than the maximum one more month to arrive at the current date , Then when I get to the current date stop the loop I made the following code. Thank you
from datetime import datetime, timedelta
# Declaração de variaveis
meses = 1
dias_por_mes = 31
data_min = datetime.strptime('2012-10-01', '%Y-%m-%d')
data_max = datetime.strptime('2019-04-10', '%Y-%m-%d')
hoje = datetime.now()
# Estrutura de repetição
while (data_min < data_max):
print(data_min)
data_futura = data_min + timedelta(dias_por_mes*meses)
print(data_futura)
if data_min == data_max:
break
print('Todos os registros foram inseridos!!!')
Good afternoon Nidorus! Please be more specific where this your problem or doubt.
– Cleyton