Skip to content

Commit

Permalink
Merge pull request #129 from akhilnarang/drop-pytz-usage
Browse files Browse the repository at this point in the history
refactor: drop pytz
  • Loading branch information
akhilnarang authored Dec 9, 2024
2 parents 6655e68 + 941af4d commit 4919784
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def on_payment_authorized(payment_status):

import json
from urllib.parse import urlencode
from zoneinfo import ZoneInfo

import frappe
import pytz
from frappe import _
from frappe.integrations.utils import create_request_log, make_post_request
from frappe.model.document import Document
Expand Down Expand Up @@ -379,7 +379,7 @@ def create_recurring_profile(token, payerid):
status_changed_to = "Completed" if data.get("starting_immediately") or updating else "Verified"

starts_at = get_datetime(subscription_details.get("start_date")) or frappe.utils.now_datetime()
starts_at = starts_at.replace(tzinfo=pytz.timezone(get_system_timezone())).astimezone(pytz.utc)
starts_at = starts_at.replace(tzinfo=ZoneInfo(get_system_timezone())).astimezone(ZoneInfo("UTC"))

# "PROFILESTARTDATE": datetime.utcfromtimestamp(get_timestamp(starts_at)).isoformat()
params.update({"PROFILESTARTDATE": starts_at.isoformat()})
Expand Down

0 comments on commit 4919784

Please sign in to comment.