finished time rules and database handler for time rules