from api.utils import DateHelper date_str = '2022-10-31 12:45:00' date_obj = DateHelper.datetime_from_string(date_str)
from api.utils import DateHelper date_obj = datetime.datetime(2022, 10, 31, 12, 30, 0) date_str = DateHelper.datetime_to_string(date_obj)
from api.utils import DateHelper timezone = DateHelper.get_current_timezone()In this example, the get_current_timezone() function is used to get the current timezone. The api.utils package library contains several utility functions in addition to the DateHelper utility. These functions are designed to improve the efficiency and accuracy of data processing and analysis in python applications.