Commit bf3f111a authored by lixiaofang's avatar lixiaofang

add

parent 00605b63
......@@ -94,8 +94,8 @@ def get_one_six_days_random_time(frmt='%Y-%m-%d %H:%M:%S', num_days=0, action_ty
nows = now
now = nows + datetime.timedelta(days=1)
zeroday = str(datetime.datetime(now.year, now.month, now.day, 10, 0, 0))
lastday = str(datetime.datetime(now.year, now.month, now.day, 23, 0, 0))
zeroday = str(datetime.datetime(now.year, now.month, now.day, 9, 0, 0))
lastday = str(datetime.datetime(now.year, now.month, now.day, 22, 0, 0))
random_times = [randomDate_six_one(zeroday, lastday, frmt) for _ in range(action_num)]
have_sort_times = sorted(random_times, key=lambda date: get_list(date))
return have_sort_times
......@@ -112,8 +112,8 @@ def get_ten_last_days_random_time(num_days=None, frmt='%Y-%m-%d %H:%M:%S', conte
return []
##比较当前时间和最后一次创建时间的差
now = datetime.datetime.now()
zeroday = datetime.datetime(now.year, now.month, now.day, 10, 0, 0)
lastday = datetime.datetime(now.year, now.month, now.day, 23, 0, 0)
zeroday = datetime.datetime(now.year, now.month, now.day, 9, 0, 0)
lastday = datetime.datetime(now.year, now.month, now.day, 22, 0, 0)
add_number = 0
if num_days > 15 and action_type in ("follow"):
action_num = random.randint(1, 2)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment