Interval lottery

data_list = [ "task list, lottery start time lottery_date, lottery end time end_time, time interval lottery_time_num"] 
# can take minute intervals during the whole lottery
F_Time = 3 * 60
for obj in DATA_LIST:
P_time obj.lottery_time_num * 60 * 60 =
= the time.time now_time ()
IF obj.lottery_date P_time + <now_time <+ F_Time obj.end_time:
b_hour = int (The time.strftime ( "% H", time.localtime (obj.lottery_date)))
_hour = int (Time .strftime ( "% H", time.localtime (the time.time ())))
_M = int (the time.strftime ( "% M", time.localtime (obj.lottery_date))) # lottery time points
if int (_minute) in [_M, _M +. 1, _M + 2]:
Status =. 1
IF (_hour - b_hour)% int (obj.lottery_time_num) == 0:
open_award(obj.active_id, obj.award_id, obj.gold_count)

Guess you like

Origin www.cnblogs.com/laowang-106/p/11404845.html