Skip to content

Instantly share code, notes, and snippets.

@cougarwww
Created January 23, 2013 06:09
Show Gist options
  • Save cougarwww/4602497 to your computer and use it in GitHub Desktop.
Save cougarwww/4602497 to your computer and use it in GitHub Desktop.
import datetime
from django.utils.timezone import utc
start_date = datetime.datetime.utcnow().replace(tzinfo=utc) - datetime.timedelta(minutes=1)
end_date = datetime.datetime.utcnow().replace(tzinfo=utc)
old_date = datetime.datetime(2013, 1, 1).replace(tzinfo=utc)
run_crons = applyDB.objects.filter(status='2', apply_run_time__range=(start_date, end_date)) # 申请通过,到期执行
old_crons = applyDB.objects.filter(status='1', apply_run_time__range=(old_date, end_date)) # 申请到期未审核
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment