Python code return interval of date if date are between two month

Hi guys I need help.

I have a generic date (endDt of type Date) and, in python, I need to get all the dates that are from endDt going back of 7 days:
Dy1=endDt-6
Dy2=endDt-5
Dy3=endDt-4
Dy4=endDt-3
Dy5=endDt-2
Dy6=endDt-1
Dy7=endDt

This must also work when the time window has days between two months and considering the differences of days between different months and leap years.

Thx to all that can tell me some input.

system.date.addDays(endDt, -1) will handle months, leap years, etc, appropriately.

https://docs.inductiveautomation.com/pages/viewpage.action?pageId=58603988

Thank you PG i’m new to ignition and i need to become more confident with your documentation.
I’ll test it (tomorrow) and i’ll consider more this community to have some ‘inspiration’ in future.
C.