Ecclesiastes 8:5

New International Version Bible (NIV)
Whoever obeys his command will come to no harm,
    and the wise heart will know the proper time and procedure.

Read Ecclesiastes 8:5 in other translations