def get_sec_since_midnight(date):
    midnight = date.replace(hour=0, minute=0, second=0, microsecond=0)
    delta = date - midnight
    return delta.seconds
Query the _all_docs view.
dataset/ETHPy150Open Crystalnix/omaha-server/omaha_server/omaha/utils.py/get_sec_since_midnight--crossover with--dataset/ETHPy150Open nephics/tornado-couchdb/couch/couch.py/AsyncCouch.view_all_docs