Skip to content

Commit e671903

Browse files
committed
[2025-02-03 12:08] Secondary Timezone fix patch
1 parent 10d58e0 commit e671903

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

weather_provider_api/routers/weather/sources/cds/client/era5land.py renamed to weather_provider_api/routers/weather/sources/cds/client/era5land_repository.py

File renamed without changes.

weather_provider_api/routers/weather/sources/cds/client/era5sl_repository.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -128,9 +128,10 @@ def _get_file_list_for_period(self, start: datetime, end: datetime):
128128
for file in full_list_of_files:
129129
file_year = int(file[len_filename_until_date : len_filename_until_date + 4])
130130
file_month = int(file[len_filename_until_date + 5 : len_filename_until_date + 7])
131-
date_for_filename = datetime(year=file_year, month=file_month, day=15)
131+
date_for_filename = datetime(year=file_year, month=file_month, day=15).astimezone(UTC)
132132

133-
if start.replace(day=1) < date_for_filename < datetime(year=end.year, month=end.month, day=28):
133+
134+
if start.replace(day=1) < date_for_filename < datetime(year=end.year, month=end.month, day=28).astimezone(UTC):
134135
# If the file is within the requested period, save it to the list of filtered files
135136
list_of_filtered_files.append(file)
136137

0 commit comments

Comments
 (0)