|
@@ -645,6 +645,35 @@ GCqvlyw5dfxNA+EtxNE2wCW/LW7ENJlACgcfgPlBZtpLheWoZB/maw4=
|
|
|
time_list = [time_tuple]
|
|
|
return time_list
|
|
|
|
|
|
+ @staticmethod
|
|
|
+ def cutting_time_stamp(start_time, end_time):
|
|
|
+ """
|
|
|
+ 按天切割时间段
|
|
|
+ @param start_time: 开始时间
|
|
|
+ @param end_time: 结束时间
|
|
|
+ @return: time_list 切割后的时间列表
|
|
|
+ """
|
|
|
+
|
|
|
+ time_list = []
|
|
|
+ while True:
|
|
|
+ mid_time = datetime.datetime(start_time.year, start_time.month, start_time.day)+relativedelta(days=1)
|
|
|
+ if mid_time < end_time:
|
|
|
+ time_tuple = (CommonService.str_to_timestamp(start_time.strftime('%Y-%m-%d %H:%M:%S')),
|
|
|
+ CommonService.str_to_timestamp(mid_time.strftime('%Y-%m-%d %H:%M:%S')))
|
|
|
+ time_list.append(time_tuple)
|
|
|
+ start_time = mid_time
|
|
|
+ else:
|
|
|
+ time_tuple = (CommonService.str_to_timestamp(start_time.strftime('%Y-%m-%d %H:%M:%S')),
|
|
|
+ CommonService.str_to_timestamp(end_time.strftime('%Y-%m-%d %H:%M:%S')))
|
|
|
+ if time_tuple not in time_list:
|
|
|
+ time_list.append(time_tuple)
|
|
|
+ break
|
|
|
+ if not time_list:
|
|
|
+ time_tuple = (CommonService.str_to_timestamp(start_time.strftime('%Y-%m-%d %H:%M:%S')),
|
|
|
+ CommonService.str_to_timestamp(end_time.strftime('%Y-%m-%d %H:%M:%S')))
|
|
|
+ time_list = [time_tuple]
|
|
|
+ return time_list
|
|
|
+
|
|
|
@staticmethod
|
|
|
def get_domain_name():
|
|
|
"""
|