From a5f4b9e5b87b7956a2a48364b3008ea5175e5b3f Mon Sep 17 00:00:00 2001 From: ekatef Date: Sat, 23 Dec 2023 08:51:05 +0300 Subject: [PATCH] Start WDPA dates from the next month --- scripts/retrieve_databundle_light.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/retrieve_databundle_light.py b/scripts/retrieve_databundle_light.py index 4377a39fa..1583cc245 100644 --- a/scripts/retrieve_databundle_light.py +++ b/scripts/retrieve_databundle_light.py @@ -276,7 +276,10 @@ def get_first_day_of_month(date): def get_first_day_of_previous_month(date): return get_first_day_of_month(date - dt.timedelta(days=1)) - current_first_day = get_first_day_of_month(dt.datetime.today()) + # starting from the next month to check the current and the previous after + current_first_day = get_first_day_of_month( + dt.datetime.today() + dt.timedelta(days=31) + ) if hot_run: if os.path.exists(file_path):