diff --git a/erpnext/support/doctype/service_level_agreement/service_level_agreement.py b/erpnext/support/doctype/service_level_agreement/service_level_agreement.py index 7f4e9efa94..2a078c4395 100644 --- a/erpnext/support/doctype/service_level_agreement/service_level_agreement.py +++ b/erpnext/support/doctype/service_level_agreement/service_level_agreement.py @@ -13,8 +13,8 @@ from frappe.utils import ( get_datetime, get_datetime_str, get_link_to_form, + get_system_timezone, get_time, - get_time_zone, get_weekdays, getdate, nowdate, @@ -981,7 +981,7 @@ def convert_utc_to_user_timezone(utc_timestamp, user): def get_tz(user): - return frappe.db.get_value("User", user, "time_zone") or get_time_zone() + return frappe.db.get_value("User", user, "time_zone") or get_system_timezone() @frappe.whitelist() diff --git a/erpnext/utilities/doctype/video/video.py b/erpnext/utilities/doctype/video/video.py index 13b7877b21..62033a5e18 100644 --- a/erpnext/utilities/doctype/video/video.py +++ b/erpnext/utilities/doctype/video/video.py @@ -10,6 +10,7 @@ import pytz from frappe import _ from frappe.model.document import Document from frappe.utils import cint +from frappe.utils.data import get_system_timezone from pyyoutube import Api @@ -64,7 +65,7 @@ def update_youtube_data(): frequency = get_frequency(frequency) time = datetime.now() - timezone = pytz.timezone(frappe.utils.get_time_zone()) + timezone = pytz.timezone(get_system_timezone()) site_time = time.astimezone(timezone) if frequency == 30: diff --git a/erpnext/www/book_appointment/index.py b/erpnext/www/book_appointment/index.py index dfca9465ed..f50c207ab9 100644 --- a/erpnext/www/book_appointment/index.py +++ b/erpnext/www/book_appointment/index.py @@ -4,6 +4,7 @@ import json import frappe import pytz from frappe import _ +from frappe.utils.data import get_system_timezone WEEKDAYS = ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"] @@ -125,7 +126,7 @@ def filter_timeslots(date, timeslots): def convert_to_guest_timezone(guest_tz, datetimeobject): guest_tz = pytz.timezone(guest_tz) - local_timezone = pytz.timezone(frappe.utils.get_time_zone()) + local_timezone = pytz.timezone(get_system_timezone()) datetimeobject = local_timezone.localize(datetimeobject) datetimeobject = datetimeobject.astimezone(guest_tz) return datetimeobject @@ -134,7 +135,7 @@ def convert_to_guest_timezone(guest_tz, datetimeobject): def convert_to_system_timezone(guest_tz, datetimeobject): guest_tz = pytz.timezone(guest_tz) datetimeobject = guest_tz.localize(datetimeobject) - system_tz = pytz.timezone(frappe.utils.get_time_zone()) + system_tz = pytz.timezone(get_system_timezone()) datetimeobject = datetimeobject.astimezone(system_tz) return datetimeobject