def start(self):
global TIME_TO_FREEZE
global TZ_OFFSET
self.previous_time_to_freeze = TIME_TO_FREEZE
self.previous_tz_offset = TZ_OFFSET
if isinstance(self.time_to_freeze, original_date):
TIME_TO_FREEZE = self.time_to_freeze
# Convert to a naive UTC datetime if necessary
if TIME_TO_FREEZE.tzinfo:
TIME_TO_FREEZE = TIME_TO_FREEZE.astimezone(utc).replace(tzinfo=None)
else:
TIME_TO_FREEZE = parser.parse(self.time_to_freeze)
TZ_OFFSET = self.tz_offset
return self.time_to_freeze
评论列表
文章目录