Skip to content

Commit

Permalink
run linter and update reused variable name
Browse files Browse the repository at this point in the history
run linter and update reused variable name
  • Loading branch information
DJensen94 committed Feb 20, 2025
1 parent 5157e2c commit 34a437f
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions backend/src/xfd_django/xfd_api/helpers/date_time_helpers.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
"""Helper methods to deal with date and time manipulation."""
# Standard Python Libraries
import datetime

def calculate_days_back(days_ago:int):

def calculate_days_back(days_ago_int: int):
"""Create a date string of a calculated past date."""
# Step 1: Get the current date and time in UTC
current_time = datetime.datetime.now(datetime.timezone.utc)
# Step 2: Subtract days from the current date
days_ago = current_time - datetime.timedelta(days=days_ago)
days_ago = current_time - datetime.timedelta(days=days_ago_int)
# Step 3: Convert to an ISO 8601 string with timezone (e.g., UTC)
since_timestamp_str = days_ago.isoformat()

return since_timestamp_str
return since_timestamp_str

0 comments on commit 34a437f

Please sign in to comment.