uranusjr commented on a change in pull request #20508:
URL: https://github.com/apache/airflow/pull/20508#discussion_r780968724



##########
File path: airflow/utils/dates.py
##########
@@ -257,7 +257,9 @@ def days_ago(n, hour=0, minute=0, second=0, microsecond=0):
     Get a datetime object representing `n` days ago. By default the time is
     set to midnight.
     """
-    today = timezone.utcnow().replace(hour=hour, minute=minute, second=second, 
microsecond=microsecond)
+    today = datetime.now(timezone.TIMEZONE).replace(
+        hour=hour, minute=minute, second=second, microsecond=microsecond
+    )

Review comment:
       Maybe
   
   ```python
   datetime.combine(
       date.today(),
       time(hour, minute, second, microsecond, tzinfo=timezone.TIMEZONE),
   )
   ```
   
   is easier to understand?




-- 
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