Modified the current_datetime_utcvariable in the statistics_hourly_data_by_period method

pull/77/head
Caozhenhui 2021-11-04 19:49:23 +08:00
parent caa65ef136
commit 67f22d2dd3
1 changed files with 3 additions and 1 deletions

View File

@ -765,7 +765,9 @@ def statistics_hourly_data_by_period(rows_hourly, start_datetime_utc, end_dateti
variance = None variance = None
# calculate the start datetime in utc of the first day in local # calculate the start datetime in utc of the first day in local
start_datetime_local = start_datetime_utc + timedelta(hours=int(config.utc_offset[1:3])) start_datetime_local = start_datetime_utc + timedelta(hours=int(config.utc_offset[1:3]))
current_datetime_utc = start_datetime_local.replace(hour=0) - timedelta(hours=int(config.utc_offset[1:3])) weekday = start_datetime_local.weekday()
current_datetime_utc = \
start_datetime_local.replace(hour=0) - timedelta(days=weekday, hours=int(config.utc_offset[1:3]))
while current_datetime_utc <= end_datetime_utc: while current_datetime_utc <= end_datetime_utc:
sub_total = Decimal(0.0) sub_total = Decimal(0.0)
for row in rows_hourly: for row in rows_hourly: