potiuk commented on code in PR #30083:
URL: https://github.com/apache/airflow/pull/30083#discussion_r1136246170


##########
airflow/timetables/_cron.py:
##########
@@ -113,7 +119,13 @@ def _get_prev(self, current: DateTime) -> DateTime:
         if not self._should_fix_dst:
             return convert_to_utc(make_aware(scheduled, self._timezone))
         delta = naive - scheduled
-        return convert_to_utc(current.in_timezone(self._timezone) - delta)
+        # calculate the delta to the next scheduled time, taking into account
+        # if the next scheduled time is in a different tz
+        current_offset = current.in_timezone(self._timezone).utcoffset()
+        scheduled_offset = instance(scheduled, self._timezone).utcoffset()
+        utc_offset_delta = current_offset - scheduled_offset
+        delta = naive - scheduled

Review Comment:
   (was repeated it seems)



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to